Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I write a shell script something like this:

php script1.php
php script2.php

What happens when I run it? Does shell wait until script1.php has finished before moving onto php script2.php or does the 2nd line get ran immediately after the first?

If the latter, how can I get it to behave like the former?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

All shell commands are executed sequentially and each command is executed after finishing the previous one unless you run a command in the background by appending ampersand & at the end of the command.

share|improve this answer
    
Thanks very much –  Lucas Scholten Sep 16 '12 at 13:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.