Trying to execute the shell script [message #439711] |
Tue, 19 January 2010 03:41 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
smartshalu
Messages: 1 Registered: January 2010 Location: Chennai
|
Junior Member |
|
|
Hi,
I am trying to run the shell script in bin path but getting the following errors
sample_email.txt[3]: Program: not found.
sample_email.txt[18]: ^M: not found.
sample_email.txt[20]: ^M: not found.
sample_email.txt[21]: Syntax error at line 30 : `<<' is not matched
attached the script for reference..
#!/usr/bin/ksh
first_file="absolute path of the file"
file1_flag=0
if [ -s $first_file ]
then
echo "First batch file is generated with size greater than zero bytes....."
file1_flag=1
fi
if [ $file1_flag -eq 1 ] ]
then
uuencode $first_file $first_file | mailx -m -r mail_id1 -s "This is Subject" mailid2 << EOF
Here this is BODY part of Mail.....
Regards
Sender
EOF
if [ $? -eq 0 ]
then
echo "Mail sent successfully.............Enjoy the day... "
else
echo "Check Protocol and port specifications..... "
fi
fi
request to please provide solution..as it is a bit urgent..
Thanks & Regards
[Updated on: Tue, 19 January 2010 04:01] Report message to a moderator
|
|
|
Re: Trying to execute the shell script [message #439722 is a reply to message #439711] |
Tue, 19 January 2010 04:03 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
When you transfer from Windows to Unix, do it in TEXT mode.
Now you can use "dos2unix" command or if it does not exist just simply remove the last character of each line.
Note this is an Oracle forum which is not intended to answer Unix question unless it is related to Oracle.
Regards
Michel
[Updated on: Tue, 19 January 2010 04:04] Report message to a moderator
|
|
|
Re: Trying to execute the shell script [message #441549 is a reply to message #439711] |
Mon, 01 February 2010 19:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
oratab
Messages: 5 Registered: April 2008 Location: Atlanta and/or Kansas Cit...
|
Junior Member |
|
|
look at the line with "uuencode" and "mail" in it.
Remove the space between << and EOF.
Make sure that the matching EOF below has no white space before it.
Google for "shell script" "here document" for further details.
|
|
|