sftp result


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp result
# 1  
Old 08-22-2007
sftp result

Hi, I have a sftp account to another server, from which I need to find out all the files match "*.abc.*.xml" pattern in a certain directory. I have a batchfile as follows

cd /tmp
ls -l *.abc.*.xml
quit

then I run

output=`/usr/local/bin/sftp -B $batchfile $USER@$HOST`

the result looks like following

sftp> quitl *.abc.*.xml5 2005 99999.abc.us_usap_36031_.xmll

how can I get it to be

1.abc.2.xml
2.abc.3.xml
3.abc.4.xml
a.abc.b.xml

Please help, thanks!
# 2  
Old 08-22-2007
Can you run the sftp command manually and check the output? Is that as expected?
# 3  
Old 08-22-2007
yes, I did, it's exactly what i expected. But through batch, things come out differently, thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare the current result with previous line result.?

Hi Gurus, I have requirement to compare current result with previous reuslt. The sample case is below. 1 job1 1 1 job2 2 1 job3 3 2 job_a1 1 2 job_a2 2 2 job_a3 3 3 job_b1 1 3 job_b2 2 for above sample file, GID is group ID, for input line, the job run... (1 Reply)
Discussion started by: ken6503
1 Replies

2. UNIX for Dummies Questions & Answers

Sftp using batchfile - storing result local

I'm making an sftp-connection to a remote server. I want the result of an ls-command in a local file and the result of ls on another folder in another local file. Because everything has to go as fast a possible I wan't to do everyting in one connection. The command I use is : psftp -v -batch -b... (4 Replies)
Discussion started by: pistach
4 Replies

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

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

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. UNIX for Dummies Questions & Answers

what is the result of this?

if ] (1 Reply)
Discussion started by: prathimahsc
1 Replies

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

8. UNIX for Dummies Questions & Answers

display the result of wc -l with words before and after the result

hello showrev -p | wc -l returns: 381 What to do in case I want to have this output: number of lines returned by showrev -p is: 381 thx (3 Replies)
Discussion started by: melanie_pfefer
3 Replies

9. Shell Programming and Scripting

Outputting formatted Result log file from old 30000 lines result log<help required>

Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in 1) starting with "20071126 11:11:11 Machine Header 1" 1000 lines... "End machine header 1" 2) starting with "20071126 12:12:12 Machine... (5 Replies)
Discussion started by: vikas.iet
5 Replies

10. Shell Programming and Scripting

sFTP result

Hi all, batchfile ====== lcd /home/data/ cd /tmp/source/ get "*.temp.ack" quit Result from sftp ============ 1111.temp.ack| 0B | 0B/s | TOC: 00:00:01 | 100%^M ^M2222.temp.ack | 0B | 0B/s | TOC: 00:00:01 | 100%^M ^M3333.temp.ack | 0B | 0B/s | TOC: 00:00:01 | 100%^M ^M As I don't know... (4 Replies)
Discussion started by: mpang_
4 Replies
Login or Register to Ask a Question