LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-05-2008, 04:52 PM   #1
babag
Member
 
Registered: Aug 2003
Posts: 419

Rep: Reputation: 31
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 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.
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: 419

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

BabaG
 
  


Reply



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 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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration