Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To execute next UNIX command after ending SFTP process.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: To execute next UNIX command after ending SFTP process.
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

Site Director


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

PostPosted: Fri Mar 21, 2008 3:25 am    Post subject:
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    Post subject: Reply to: To execute next UNIX command after ending SFTP pro
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

Site Director


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

PostPosted: Fri Mar 21, 2008 6:39 am    Post subject:
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    Post subject: To execute next UNIX command after ending SFTP process.
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP from Mainframe to Unix - with CRLF vasanthz All Other Mainframe Topics 6 Thu Mar 23, 2017 5:12 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us