Hi All,
I am a newbee in unix but still have written a shell script which should trigger a mail based on certain conditions but the problem is that my file is not being read. Below is the code please advise. I do not know where is it failing.
Note $ and the no followed with it is the no of the column in the Flat file
HOME=/export/home/ls/report/
$ORACLE_HOME/bin/sqlplus -s user_name/password@database < /export/home/ls/report/notification.sql > /export/home/ls/report/filename.txt
cat /export/home/ls/report/filename.txt |
while read line awk `
BEGIN {
NOTE='Do not respond to this email as it was generated via an automatic process'
}
{
if ( $3 = 'Status' ) (
Content= 'Please move the incident to next status'
if ($7 >= 0 && $7 <= 14 )
{
printf ("\nmailx -r user_name@comapny.com -s "Incident Number :" ,$1 ,$36 ,"-c ",$28",$Content,$NOTE)>> /export/home/ls/report/initial1.txt
}
if ($8 >= 15 && $8 <= 29 )
{
printf ("\nmailx -r user_name@comapny.com -s "FO Number :" $1 $36 -c $28")
}
if ($9 >= 30 )
{
printf ("\nmailx -r user_name@comapny.com s %s",$36," %s", $28)
}
continue
)
}
END {
}`