The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl question regarding [ ] hankooknara Shell Programming and Scripting 2 07-01-2007 04:21 PM
Perl Question serm Shell Programming and Scripting 2 09-28-2006 05:50 AM
Perl Question Gary Dunn Shell Programming and Scripting 2 12-03-2004 12:37 PM
PERL question frank Shell Programming and Scripting 1 06-18-2002 03:13 AM
Perl question Jubba Shell Programming and Scripting 1 04-01-2002 02:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-09-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 141
perl question

If I use 2 system commands in a script, will one finish before the next one starts? or will it start the first and the second at the same time?
i.e.

system("ps | grep rminer");
system("ls -al | grep 431");
  #2 (permalink)  
Old 09-09-2005
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
In general, It should run one command, wait for it to complete, before executing the other.

Of course, it will not if the command is launched in the background, with "&" or if the program itself is configured to automatically put itself in background mode, such as gvim.

From the manpage for "system":
Quote:
Does exactly the same thing as "exec LIST", except that a fork is done first, and the parent process waits for the child process to complete.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 08:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0