LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 04-05-2008, 04:52 PM   #1
babag
Member
 
Registered: Aug 2003
Posts: 365

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?

thanks,
BabaG
 
Old 04-05-2008, 05:01 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 54
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.
Code:
ssh user@there yourscript.sh &
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, 05:10 PM   #3
babag
Member
 
Registered: Aug 2003
Posts: 365

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

BabaG
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 10:45 PM.

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