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
Exit Shell Prompt after Pbrun ishanc Shell Programming and Scripting 4 02-25-2009 11:11 AM
Exit Status of SFTP uni1234 Shell Programming and Scripting 1 10-11-2007 02:03 PM
Exit codes in SFTP vikramsnest Shell Programming and Scripting 1 08-16-2007 02:08 AM
sftp hanging on exit max29583 UNIX for Advanced & Expert Users 1 08-16-2007 02:04 AM
how to find the exit status for the last executed command vijay.amirthraj UNIX for Dummies Questions & Answers 1 07-04-2006 10:14 PM

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 04-09-2008
Karteek Karteek is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 1
How to get the exit satus of a command which I executed in sftp prompt

Hi All,

I need the exit status of a command which is executed through sftp connection.

Example:

sftp user@host <<EOF
mkdir /home/karteek/testing
put /home/xyz.txt /home/karteek/testing
EOF
------
In the above example, I need the exit status of the put command.

Please help me.

The reason for using sftp is that, I need to crate the directories in remote machine.

Thanks,
Karteek
  #2 (permalink)  
Old 04-09-2008
push push is offline
Registered User
  
 

Join Date: Nov 2007
Location: Pune
Posts: 22
The easy way will be to take status of whole process

Quote:
sftp user@host <<EOF &&
mkdir /home/karteek/testing &&
put /home/xyz.txt /home/karteek/testing &&
EOF
status=$?
  #3 (permalink)  
Old 04-09-2008
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
Additionally, you could always put the output to a text file and after you come out of the sftp process, check the output file for what ever criteria you wish to confirm all has gone well.
Sponsored Links
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 04:53 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