Passing parameter inside the expression

Hello,

i need to pass the variable in place of pwd. how to display variable in the bleow syntax.
suppose, passwd="test", then 'id/$passwd.....

 FEDFlagResult=`sqlplus -S 'id/pwd@(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1643))(CONNECT_DATA=  (SID=peta1)))'<< EOF
select count   from country
exit;
EOF`

note: there is a ` at the begining and ' before id. so, $passwed needs to be added inside of these 2 ( ` and ' )

Regards
B

Two comments:

  • replace (deprecated) `...` with (recommended) $(...)
  • try "'" in place of the single quotes '

hello,

sqlplus is giving syntax error for the below .. pls suggest.

=`sqlplus -S id/'$passwd'@(DESCRIPTION ........

Did you listen to anything anyone said?

You have shown us an assignment statement with no variable being assigned, an opening backquote with no closing backquote, a variable that won't be expanded inside single quotes, and an open parenthesis without a closing parenthesis. Except for not expanding a variable inside singe quotes, all of these are syntax errors.

Show us the complete statement. Show us the exact diagnostic produced. Explain why you chose to ignore the suggestions RudiC made.

And, please, use CODE tags when showing us sample input, output, and code.