LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-10-2008, 07: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, 07:39 PM   #2
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
nope, all shells will wait for a command to complete execution until it is done.
 
Old 09-10-2008, 09: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 09:42 PM. Reason: fix typo
 
Old 09-10-2008, 11:21 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
It'll still only do one cmd at a time...
 
Old 09-10-2008, 11:49 PM   #5
normscherer
Member
 
Registered: Sep 2005
Location: Prescott, AZ
Distribution: Ubuntu Mate 18 LTS
Posts: 50

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



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 06:12 AM
Linux "Wait" command? renegadeavenger Fedora 10 05-28-2005 05:22 PM
Running a command from anywhere tez Linux - Newbie 5 02-27-2004 10:07 PM
command running on cd in Daem0hn Linux - General 3 07-22-2003 03:13 AM
wait for x seconds type command sub-genius Slackware 1 07-14-2003 07:11 PM

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

All times are GMT -5. The time now is 07:43 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
Open Source Consulting | Domain Registration