Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to be able to copy/paste into terminal;

wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
mv wordpress/* .
rmdir wordpress
rm latest.tar.gz

But I want correct wait commands in there so it doesn't try to move the wordpress directory before it's finished extracting.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You don't need any "wait" command, it's fine as it is. Your tar command is not being backgrounded, so the script has no choice but to wait for it to finish before executing the next command.

Take a look at this thread for example: http://unix.stackexchange.com/questions/26506/wait-for-process-to-finish-before-going-to-the-next-line-in-shell-script

share|improve this answer
    
Thanks @duDE, good to know. –  SMacFadyen Sep 5 '13 at 11:33

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.