IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To execute next UNIX command after ending SFTP process.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gautamc

New User


Joined: 15 Mar 2008
Posts: 3
Location: US

PostPosted: Fri Mar 21, 2008 2:34 am
Reply with quote

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..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 21, 2008 3:25 am
Reply with quote

Hello gautamc and welcome to the forums,

You might:
- try moving "exit" onto the same line as "sftp"
- try using "bye" or "quit" instead of "exit"
Back to top
View user's profile Send private message
gautamc

New User


Joined: 15 Mar 2008
Posts: 3
Location: US

PostPosted: Fri Mar 21, 2008 6:08 am
Reply with quote

I checked them all, but none of the worked.

-exit in same line does not help, as by sftp you are just connecting to other server, but you need to execute 'mput' command to transfer the file.
- 'bye' & 'QUIT' command exits from UNIX session. But I want to execute UNIX command without logging out of session.

So let me know if it is possible to execute further or another script without logging.

Thanks for your help..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 21, 2008 6:39 am
Reply with quote

Hello,

Quote:
So let me know if it is possible to execute further or another script without logging.
As i recall, our file transfers did not automagically log the user off of the system. . . It has been a while since i had a UNIX server to work with, so this is all from memory. . .

Have you done any research on sftp? I just found out (web search) that bye, quit, and exit all cause the connection to be terminated and the user logged off (if i read it correctly). For a test you might remove these.

Not in your original post, but later, you mention mput. I am not sure that sftp supports mput -ftp does, but maybe not sftp.

What is in your batch file ( -b path ) and what do you want -vvv to do? -v should specify "verbose", but i have no idea what -vvv is supposed to do.
Back to top
View user's profile Send private message
gautamc

New User


Joined: 15 Mar 2008
Posts: 3
Location: US

PostPosted: Fri Mar 21, 2008 11:01 pm
Reply with quote

Well I am using SFTP for sometime now & I never had a requirement to execute UNIX commands after logging out of SFTP.
Well SFTP just logs into the other server, but in order to move the file we have to execute 'mput' & other command. & '-b' option excute the UNIX command in the script at location 'path' & -vvv is also for verbose.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
Search our Forums:

Back to Top