Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-05-2008, 05:52 PM   #1
Registered: Aug 2003
Posts: 373

Rep: Reputation: 30
bash - order of commands when calling remote script?

if i use a bash script to ssh into a remote computer
and run a bash script on that remote computer, does
my local bash script continue:

a. after the call is make to the remote script?
b. after the remote script starts running?
c. after the remote script finishes running?

if c, is there a way of jumping back to the local
script so that it can continue, leaving the remote
script running? how would i do that?

Old 04-05-2008, 06:01 PM   #2
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
The answer to question 1 is c.
The answer to question 2 is to add an ampersand to the end of the ssh command line - i.e.
ssh user@there &
This will tell your local bash script to invoke ssh and immediately continue to the next command. The ssh command is performed as a child process.
Old 04-05-2008, 06:10 PM   #3
Registered: Aug 2003
Posts: 373

Original Poster
Rep: Reputation: 30
thanks ian! this is great! very helpful.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling awk commands in perl script bharatbsharma Other *NIX 3 11-02-2007 08:07 PM
calling awk commands in perl script bharatbsharma Programming 6 11-02-2007 11:23 AM
Order of functions in a bash script essdeeay Programming 1 05-02-2006 11:52 PM
bash - execute commands on a remote machine capture results, etc dkrysak Programming 1 11-18-2005 02:50 PM
bash script calling mplayer afrodocter Programming 13 08-23-2005 11:41 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration