Error in scripts

I am using following code but getting error
Error on line 136:
(SQR 3710) Unknown argument type.

Given below part of program where i am getting error.......

input $p_region type=char

if ( '$p_region' = 'ESAP' )
let $msg = 'YES'
do log_msg ({PROG_NAME}, {SEV_INFO}, $msg)
else
let $msg = 'NO'
do log_msg ({PROG_NAME}, {SEV_INFO}, $msg)
fi

could you please let me know what is the solution for this.

... although I might be wrong.

But,
(a) when there is an if there is normally a then -- did not see it.
(b) where you use ' single quotes, I have found that this does not quite the same variable substitution; thus using " double quotes often does the correct substitution.

p_region="ESAP"
if ( "$p_region" -eq 'ESAP' )
then
msg='YES'
else
msg='NO'
fi
echo $msg

If i m not making mistake, for me it doesnt look like a shell code ?
It would be better if you could explain what you are trying to do so we can suggest you some other possible and easy ways.

  • nilesh

If this is a unix script, then -eq is for integers.
Perhaps

if ( "$p_region" -eq 'ESAP' )

should be

if [ "$p_region" = "ESAP" ]

???

Can we use round brackets in if command?

if ( '$p_region' = 'ESAP' )

should be

if [ '$p_region' == 'ESAP' ]

Also 'then' part is missing in the script.