I am new to shell script programming. I have written a ksh script to run the sql File placed in server directory and spool the output in destination directory.
Below Command:
Try a here document like this:
I am assuming the things with a $ are shell variables.
Which you should write like this so somebody later on can figure it out:
# like this: ${variable goes here}
# example:
${ora_uid}
Example here document starts with -EOF, end with EOF:
$ORACLE_HOME/bin/sqlplus -s ${ora_uid} <<-EOF
[set commands go here]
spool ${opfiledirectory}
@${sqlfile_loc}${testquery.sql}
spool off
EOF
I suspected as much. You have an OS problem not a code problem. Windows and Unix use different end of line characters. You'll need to convert the file in Unix to a windows format before moving it to windows for viewing.
in your Unix box from a shell window do
man unix2dos
This will change the end of line characters to windows versions and allow you to see the line breaks.
Thanks everyone for prompt response.
Found that it was issue while copying the file from unix to local system and opening in Notepad. converting the file into text mode while copying solved the issue.
In server files were ok.