Did not know that EOF should be placed at the start of the line and i have aligned according to if loop.
Anyways after moving the EOF to the start of the line, it worked like a charm.
Thanks a Lot for the Quick Reply.
---------- Post updated 04-18-12 at 03:42 PM ---------- Previous update was 04-17-12 at 04:53 PM ----------
Hello
One more doubt ... I am not able to get the isql output to temp_res file ... i have tried all the different combinations as shown below, but could not get anywhere .... Please Help
isql -S $serv_name -U $usr_name -P $pswd -D $db_name -o temp_res << EOF1
select status from modset where modsetid=$mod_id
go
exit
EOF1
isql -S $serv_name -U $usr_name -P $pswd -D $db_name << EOF1 > -o temp_res
select status from modset where modsetid=$mod_id
go
exit
EOF1
isql -S $serv_name -U $usr_name -P $pswd -D $db_name << EOF1 > temp_res
select status from modset where modsetid=$mod_id
go
exit
EOF1
temp_path="/.../.../.../.../temp_res.txt"
isql -S $serv_name -U $usr_name -P $pswd -D $db_name -o temp_path << EOF1
select status from modset where modsetid=$mod_id
go
exit
EOF1
In the script you have -o temp_res but then try reading the file with a different name cat temp_res.txt . Remember that this is unix and MSDOS-style file extensions have no special meaning.