Computing.Net > Forums > Unix > Running multiple unix scripts

Running multiple unix scripts

Reply to Message Icon

Original Message
Name: elpico
Date: April 9, 2003 at 04:42:26 Pacific
Subject: Running multiple unix scripts
OS: Solaris 8
CPU/Ram: 256
Comment:

Hi all,

I'm trying to run to scripts in a single file, where script2 can only run when script1 has completed. Is there any way I can link them using scripting?

Basically the first script kicks off a server and the second one logs in to it and starts a few services.


Any ideas/comments?

elpico.



Report Offensive Message For Removal

Response Number 1
Name: David Perry
Date: April 9, 2003 at 05:35:37 Pacific
Subject: Running multiple unix scripts
Reply: (edit)

command1 && command2

command2 will only run after the successful completion of command1


Report Offensive Follow Up For Removal

Response Number 2
Name: WilliamRobertson
Date: April 9, 2003 at 11:49:31 Pacific
Subject: Running multiple unix scripts
Reply: (edit)

Or,

if command1
then
command2
fi

What you often see is

command1
rc=$?
if [ rc -gt 0 ]
then ...

which works, but loses style points.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Running multiple unix scripts

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software