The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
How to build a command into a string rather than execute the command littlejon Shell Programming and Scripting 1 05-29-2008 08:05 PM
WRQ Reflection SFTP process hangs when run using windows scheduler kapilash Windows & DOS: Issues & Discussions 0 04-27-2006 05:26 AM
Plz Help : How to use write command to execute command on some other terminal Aashish UNIX for Dummies Questions & Answers 2 03-03-2006 12:25 PM
Track Sftp process borncrazy Shell Programming and Scripting 9 12-13-2005 02:50 AM
execute command unix with java:possible or not? mips Shell Programming and Scripting 4 05-13-2004 07:07 AM

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

Join Date: Mar 2008
Posts: 2
To execute next UNIX command after ending SFTP process.

Hi,
I am trying to run a simple UNIX command after i successfully executed SFTP command as shown below.
-----------------------------------------
echo 'Step-1'
sftp -vvv -b path
exit
echo 'Step-2'
------------------------------------------

In above script it executes from the 1st 'echo' command till the 'exit' then comes out of the script. But my requirement is to also execute the 2nd 'echo' command. So is there a way to run further UNIX command after SFTP, even by calling another script to run further command is fine.

Thanks for your help..
  #2 (permalink)  
Old 03-20-2008
curleb curleb is offline
Registered User
  
 

Join Date: Mar 2008
Location: Here, in my Ivory Tower...
Posts: 68
Skip the exit. If you are echoing your ftp-style commands, pipe it through to sftp:

Code:
 
echo "put $myfile $hostdest/$hostfile" | sftp $verbosity $hostpass $hostuser@$hostname >>$MYLOG 2>&1
Otherwise, you do much better with scp:

Code:
 
scp $loclfile $hostuser@$hostname:$trgtdir/.
  #3 (permalink)  
Old 03-20-2008
gautamc gautamc is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 2
To execute next UNIX command after ending SFTP process.

My problem is not in using SFTP command, but not able to execute any UNIX command after i successfuly completed SFTP. Currently it exits out of script after SFTP command, which i need to use. Is there a way to exit out of SFTP ?
Thanks
  #4 (permalink)  
Old 03-20-2008
curleb curleb is offline
Registered User
  
 

Join Date: Mar 2008
Location: Here, in my Ivory Tower...
Posts: 68
Again, skip the exit ... Pipe the echo through sftp which will effectively exit on its own.
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 02:37 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