Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am using the following script(SECURE_FTP.sh) to put files into a remote system.
When i am executing this script, it printing
ksh: ./SECURE_FTP.sh: not found
Can anyone guide where it is going wrong!
Thanks in advance
Rams
****************************************
#!/usr/xpg4/bin/sh
# Put a file from Secure FTP Server using TLSFTP
#Input FILEPATH,FILENAME. File is FTPed to target.
# Set PATH to execute TLSFTPPATH=$PATH:/usr/local/gwh/tlsftp
export PATH
echo $PATH
# Log file
_TIMESTAMP=`date +%Y%m%d%H%M`
# File to get in _FILENAME,File Path to get in _FILEPATH
_FILEPATH_PROCESSZONE=$1
_FILEPATH_TARGET=$2
_FILENAME_PUT=$3
_SERVERNAME=$4
_USERNAME=$5
_PASSWORD=$6echo $_TIMESTAMP:: File to put: $_FILEPATH,$_FILENAME >> ${_LOGFILE}
cd /usr/local/gwh/tlsftp
# Connect to Secure FTP Server
./tlsftp -z opts=2 verify=0 -n -i $_SERVERNAME << EOF1
user $_USERNAME $_PASSWORD
binary
cd $_FILEPATH_TARGET
lcd $_FILEPATH_PROCESSZONE
put $_FILENAME_PUT
dir $_FILEPATH_TARGET list.txt
close
bye
EOF1cd $_FILEPATH_PROCESSZONE
iFileCd=`cat list.txt|grep $_FILENAME_PUT|wc|cut -c8`
echo $iFileCd
if [ $iFileCd != 1 ]
then
echo exit val 2
exit 2
fi

Hi:
Using '#!/usr/xpg4/bin/sh' tells me that you are probably using some version of Solaris. The /usr/xpg4/bin is a directory with POSIX compliant commands.
Under Solaris 7, this is a soft link to the ksh:
sh -> ../../bin/ksh
Based on your error message:
ksh: ./SECURE_FTP.sh: not found
it can't find the ksh shell. Try changing the shell invocation to really point to the ksh. For example:
#!/usr/bin/ksh
or whereever your ksh happens to reside.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |