Home » Infrastructure » Unix » Trying to execute the shell script (HP UNIX)
icon7.gif  Trying to execute the shell script [message #439711] Tue, 19 January 2010 03:41 Go to next message
Messages: 1
Registered: January 2010
Location: Chennai
Junior Member

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..

first_file="absolute path of the file"


if [ -s $first_file ]
echo "First batch file is generated with size greater than zero bytes....."


if [ $file1_flag -eq 1 ] ]
uuencode $first_file $first_file | mailx -m -r mail_id1 -s "This is Subject" mailid2 << EOF
Here this is BODY part of Mail.....

if [ $? -eq 0 ]
echo "Mail sent successfully.............Enjoy the day... Smile "
echo "Check Protocol and port specifications..... Sad "

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 messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
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.


[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
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.
Previous Topic: How to grep $
Next Topic: Oracle Assessment, Metrics and Monitoring
Goto Forum:

Current Time: Fri May 17 23:28:56 CDT 2024