|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Syntax error displayed when sqlplus is included in a function
Hi,
I am getting a syntax error when I run the command sh -n test.sh for the below script. Contents of test.sh ------------------- #!/bin/ksh function write_to_log { MAILCNT=`sqlplus -s user/pwd <<EOT set feedback off heading off pagesize 0 select count(*) from dual; EXIT EOT` echo $MAILCNT } write_to_log $ >sh -n test.sh test.sh[8]: 0403-057 Syntax error at line 8 : `<' is not matched. However, when I remove the function and check for syntax, I don't get any errors. Contents of test1.sh (with the function commented) -------------------------------------------------- #!/bin/ksh #function write_to_log #{ MAILCNT=`sqlplus -s user/pwd <<EOT set feedback off heading off pagesize 0 select count(*) from dual; EXIT EOT` echo $MAILCNT #} #write_to_log $ >sh -n test1.sh $ > Please help me out and let me know why this is happening... Thanks in advance. |
|
#2
|
|||
|
|||
|
Please note that this is happening only in Korn shell and not in Bourne shell
|
|
#3
|
|||
|
|||
|
I have not a clue if this would be right at all, but have a look at changing
Code:
EOT` Code:
EOT ` |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Syntax error displayed when sqlplus is included in a function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|