Computing.Net > Forums > Unix > Script not executing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script not executing

Reply to Message Icon

Name: Rams
Date: October 30, 2005 at 00:18:54 Pacific
OS: unix
CPU/Ram: p4 3.0, 512mb RAM
Comment:

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 TLSFTP

PATH=$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=$6

echo $_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
EOF1

cd $_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



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: October 30, 2005 at 07:48:56 Pacific
Reply:

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.



0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Script not executing

Check for new file, exec sql*plus www.computing.net/answers/unix/check-for-new-file-exec-sqlplus/6714.html

find pathname of executing script www.computing.net/answers/unix/find-pathname-of-executing-script/2750.html

Script question.... www.computing.net/answers/unix/script-question/7518.html