The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SFTP Failed---Request for subsystem 'sftp' failed on channel 0 mahiban AIX 0 07-25-2008 03:51 AM
ls while read loop - internal read picking up wrong input dkieran Shell Programming and Scripting 2 05-14-2007 04:02 PM
Automate batchfile generation for sFTP mpang_ Shell Programming and Scripting 0 04-26-2006 06:34 AM
Cannot read in variable using read on first try normie UNIX for Advanced & Expert Users 1 10-05-2005 02:42 AM
read line and read next ariuscy UNIX for Dummies Questions & Answers 7 09-21-2005 08:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-04-2008
kmw kmw is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 2
sftp -b doesn't read the batchfile

Several of our end-users need to send a file to our insurance carrier using ssh and sftp. We've put together a Windows VBS script that opens the ssh tunnel and calls sftp with the -b option pointing to a batch script in the same directory, however sftp doesn't seems to be reading from the batchfile. There are no error messages, and once we have the sftp prompt we can manually run the lcd, cd and put commands to transfer the file. Is there another option that needs to be added to the sftp command in addition to the -b option to get it to read from the batch script? The full sftp command is:

sftp -oIdentityFile=c:\openssh\userkeys\SSHkey -oPort=999 sshuser@localhost -bsend_files.srp"

send_files.srp is something like this:

lcd J:\path\to\outgoing
cd /path/to/incoming
put file.dat
quit

We're using OpenSSH do do the transfer.

kmw
  #2 (permalink)  
Old 08-04-2008
kmw kmw is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 2
fixed it

easy...put the -b option at the *beginning* of the sftp command line:

sftp -bsend_files.srp -oIdentityFile=c:\openssh\userkeys\SSHkey -oPort=999 sshuser@localhost -bsend_files.srp"
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0