HelpPlease
12-10-2003, 10:21 AM
Ok...........i created a shell called last.sh (suppose to copy 3 txt files into 1 txt file but i get.............
$ vi last.sh
"last.sh" [Incomplete last line] 8 lines, 136 characters
# last.sh^M
#!/bin/sh^M
if [-f $4] ; then ^M
rm -f $4 ^M
touch $4^M
cat $1 $2 $3 >> $4^M
then do sh <file> file1 file2 file3 <target file>^M
fi
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"last.sh" [Incomplete last line] 8 lines, 136 character
There is something wrong in the coding because when i do...........
$ sh last.sh
last.sh: syntax error at line 7: `then' unexpected
[~]
$ ./last.sh
bash: ./last.sh: Permission denied
[~]
I don't know whats wrong
$ vi last.sh
"last.sh" [Incomplete last line] 8 lines, 136 characters
# last.sh^M
#!/bin/sh^M
if [-f $4] ; then ^M
rm -f $4 ^M
touch $4^M
cat $1 $2 $3 >> $4^M
then do sh <file> file1 file2 file3 <target file>^M
fi
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"last.sh" [Incomplete last line] 8 lines, 136 character
There is something wrong in the coding because when i do...........
$ sh last.sh
last.sh: syntax error at line 7: `then' unexpected
[~]
$ ./last.sh
bash: ./last.sh: Permission denied
[~]
I don't know whats wrong