I modified the script and everything runs good till the very last command. The last command is to call another script to run on the remote machine it has logged onto. This is the error it gives me:
bad interpreter: No such file or directory: /bin/sh
I will paste the update script below and mark in red the place the script stops.
#!/bin/sh
pos=/usr/pa/archive/warner/rodanthe/pos
archive=/usr/pa/archive/warner/vrodanth/pos/archive
dest=/usr/pa/archive/warner/vrodanth/pos/rodanth
cd "$pos"
#CHECK IF THERE ARE ANY POSITIVE PAY FILES
if [ `find . -type f -maxdepth 1 -name "1455*" | wc -l` -eq 0 ]; then
echo "Exit NO FILES"
exit
else
gunzip 1455*
for file in 1455*
do
cp "$file" "$dest/${file%%-*}"
gzip 1455*
mv "$pospay"/*.gz "$archive"
cd "$dest"
scp 1455*
abcd@xfer.whatever.com:/home/wfs
slogin
abcd@xfer.whatever.com "touch cur_dump.rodanth;echo "1455"* >> cur_dump.rodanth
;/home/abcd/remote-script"
done
fi
Thanks,
Nazs