doubt on sftp ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting doubt on sftp ?
# 1  
Old 12-10-2008
doubt on sftp ?

One script B(say) is called from another script A(say), in B it is getting some file from another unix-box through sftp protocol. problem is??
1. when I am executing B alone it is working fine..but when I am executing A,
those sftp stuffs not working?? why??

A.sh
------
------
B.sh
-----
-----
end
# 2  
Old 12-10-2008
Without being able to see your error messages and the scripts themselves, it becomes very hard to say what is going wrong.
# 3  
Old 12-10-2008
It is not throughing any error on screen, i can say simply escaping (or may not executing) those sftp steps but executing other commands after sftp.
# 4  
Old 12-10-2008
Network

Do you mind showing both scripts? You ask for more info on this thread https://www.unix.com/unix-advanced-ex...#post302266424 so why don't you give more helpful info in your case? Smilie
# 5  
Old 12-10-2008
Below piece of command:
<<<
B.sh
------
sftp $hostName <<EndFTP
cd /opt/DSOI/logfiles/report
get DSOI_report.log.$DAY
EndFTP
>>>
When i am executing this, it is working fine...But when i am calling script B from within A it is not giving the required result!!!

A.sh
-----
{
B.sh
}
# 6  
Old 12-10-2008
Ok, B looks fine if the variables are somehow substituted with values what should be the case since it works as you say when being executed directly.

Can we see A too maybe?

Edit: Btw. you can just add a "set -x" into A so you will see what's going on hopefully.

Last edited by zaxxon; 12-10-2008 at 09:08 AM.. Reason: Added something
# 7  
Old 12-10-2008
For A u can think like below:

A.sh
{
DATE = date +'%m';(say)

B.sh <hostname> $DATE -> here B is getting called, with 2 parameters

}
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Doubt..

Hi experts, In one of our code we have used some command like this. name=${name##*/} Can someone please let me know what exactly it does? Thanks & Regards, Sathya V. (1 Reply)
Discussion started by: Sathya83aa
1 Replies

2. Shell Programming and Scripting

Sftp : not able to print the echo statements after the sftp transfer

I had the below sftp script working perfectly but the problem is I am not able to send the echo statements . #!/bin/sh echo "Starting to sftp..." sftp admin@myip << END_SCRIPT cd /remotepath/ lcd /localpath/ mget myfiles*.csv bye END_SCRIPT echo "Sftp successfully." echo echo... (11 Replies)
Discussion started by: scriptscript
11 Replies

3. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

4. 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

5. UNIX for Advanced & Expert Users

doubt in df -h

in my parition i hav parition like this Filesystem Size Used Avail Use% Mounted on /dev/sda2 24G 22G 756M 97% / /dev/sda5 248G 1.2G 234G 1% /else /dev/sda1 965M 24M 892M 3% /boot tmpfs 7.0G 0 7.0G 0%... (1 Reply)
Discussion started by: ponmuthu
1 Replies

6. UNIX for Dummies Questions & Answers

Doubt

How would i create virtual interface in linux to configure more than one IP address for a physical interface? any help wll be appreciated. (1 Reply)
Discussion started by: salil2012
1 Replies

7. Shell Programming and Scripting

Doubt??

I jus want to know the meaning of the below command line(exclamation following that re-direction) sqlplus -s `cat /home/sample.txt` <<! Thanks!! (1 Reply)
Discussion started by: nohup
1 Replies

8. AIX

SFTP Failed---Request for subsystem 'sftp' failed on channel 0

Hi, While I am trying SFTP my machine to another unix machine , it was working fine till 10 min back. But now i am getting the below error "Request for subsystem 'sftp' failed on channel 0" Could you please someone help me to solve or analyise the root cause... Cheers:b:, Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies

9. UNIX for Dummies Questions & Answers

doubt on name

HI, Iam jus tin a confusion that solaris and unix are the same.if they are diffrent,how they are?pls give me a brief idea abt these two. I will be very grateful to you thanks (1 Reply)
Discussion started by: shruti_mgp
1 Replies
Login or Register to Ask a Question