LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial 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
 
Search this Thread
Old 09-10-2008, 08:32 PM   #1
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Rep: Reputation: 15
Does Kornshell wait until one command completes before running the next command?


I am writing a script that installs perl modules; here are the commands:

perl Makefile.PL
make
make test
make install

I can't remember, will kornshell wait until one command finishes before running the next one or does it just start one command and immediately start the other right after? In that case should I put a 'sleep 5' between each command? Thanks.
 
Old 09-10-2008, 08:39 PM   #2
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 31
nope, all shells will wait for a command to complete execution until it is done.
 
Old 09-10-2008, 10:41 PM   #3
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
You could put all commands on the same line separated by ';'
Quote:
perl Makefile.PL ;make ;make test; make install
If you're doing that, you probably don't even need to do the "make test"
part, as this usually only verifies that things were created correctly
and that your system has the correct setup for the install.

Last edited by rlhartmann; 09-10-2008 at 10:42 PM. Reason: fix typo
 
Old 09-11-2008, 12:21 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
It'll still only do one cmd at a time...
 
Old 09-11-2008, 12:49 AM   #5
normscherer
Member
 
Registered: Sep 2005
Location: On the road
Distribution: Ubuntu 8.10
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by rlhartmann View Post
You could put all commands on the same line separated by ';'


If you're doing that, you probably don't even need to do the "make test"
part, as this usually only verifies that things were created correctly
and that your system has the correct setup for the install.
There is no difference between a semi-colon and a newline in a shell script. With a semi-colon you just put things on one line but the sematics are the same.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[gzip] appears in process table after gzip command completes redmanDBA Linux - General 0 02-26-2008 07:12 AM
Linux "Wait" command? renegadeavenger Fedora 10 05-28-2005 06:22 PM
Running a command from anywhere tez Linux - Newbie 5 02-27-2004 11:07 PM
command running on cd in Daem0hn Linux - General 3 07-22-2003 04:13 AM
wait for x seconds type command sub-genius Slackware 1 07-14-2003 08:11 PM


All times are GMT -5. The time now is 12:52 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration