Why sftp not found in my script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Why sftp not found in my script
# 1  
Old 05-03-2012
Why sftp not found in my script

Please help

I can run sftp command as following
Code:
sdbs03:/a01/emm/hsup/sche/bin/dtms/si% sftp aispx02@STGISPDBS1
Connecting to STGISPDBS1...
sftp> bye

It seem ok, no any problem, but if I write a script and call sftp in the script, it show sftp not found error. following is my script file and result

Code:
sdbs03:/a01/emm/hsup/sche/bin/dtms/si% ./test.sh
./test.sh: sftp:  not found.
sdbs03:/a01/emm/hsup/sche/bin/dtms/si% cat test.sh
sftp -C aispx02@STGISPDBS1
exit $?

anyone can help me, thank you very much

Last edited by Franklin52; 05-04-2012 at 05:45 AM.. Reason: Please use code tags
# 2  
Old 05-04-2012
use the absolute path of sftp

the below command gives you the path of sftp
Code:
 
which sftp

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ls incorrectly says file not found in sftp.

Hi all When I sftp to an Oracle cloud server, to a folder where there are more than 10k files, and list a small subset of files, it works OK. When I try list more than 10k files, it says file not found. Example output below. (FYI ls/mget with 6k files works OK on this server) Has anyone... (3 Replies)
Discussion started by: pdinsdale
3 Replies

2. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

Dear All, I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies

3. Shell Programming and Scripting

./CARE_SM_SFTP.sh[27]: put: not found error while doing sftp

Hi, I am getting the below error while doing sftp in a script file but the same is getting executed when i run from command prompt ./CARE_SM2_SFTP.sh: put: not found Code :- sftp ${USER_ID}@${FTPHOST4}:/opt/path put <Filename with path> chmod 777 <FileName with Path>... (2 Replies)
Discussion started by: satishmallidi
2 Replies

4. Fedora

sftp Unspecified GSS failure Minor code may provide more information No credentials cache found

Hi I have managed on numerous machine to set up sftp not too require a password - i finally have one that does not work and Im at a loss - looked around checked permissions etc The 2 machines Ill call then source and target I need to sftp from source to target (previously the target has... (3 Replies)
Discussion started by: wwwdaryl
3 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. SuSE

scp/sftp only files which are not found.

Hi, I need to write a script to scp/sftp files from server A to server B..But i do not want to overwrite the files which already exist on server B. Anyone has a script which does the above Regards (2 Replies)
Discussion started by: SystemEng
2 Replies

7. UNIX for Dummies Questions & Answers

Not Found message in script execution

Hi gurus, I'm having a strange problem and I hope you can help me solving it. I'm working in Unix Solaris, version 5.10, ksh. I have a script with environment variables which I have to execute prior to other scripts. The script belongs to userA and when I log in, and cd to its directory. It... (4 Replies)
Discussion started by: ermur
4 Replies

8. Shell Programming and Scripting

Ping not found from the script

Hi, I have written a script which pings a host. When I executed the script, it is saying that test_mail.sh: line 1: PING: command not found But if I run the ping from command prompt like "ping -c 1 piias1576" I am getting perfect result. `/bin/ping -c 1 piias1576` if then mail sibasha... (5 Replies)
Discussion started by: siba.s.nayak
5 Replies

9. Shell Programming and Scripting

Script not found to run

In one environment I cannot run a shell script, which can run on other environment both has same rights. Even though I try to run from the same dir, it gives me an error, mentioning - script not found. But this same script can be found, if we run find command. Script starts with #!/bin/sh ... (1 Reply)
Discussion started by: videsh77
1 Replies
Login or Register to Ask a Question