Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to do such as following:

#!/bin/bash
command1
pause 30 seconds
command2
exit

This is only example script with pause of 30 seconds between run of 2 command.

How to do this?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You can use this in a terminal:

command1 && sleep 30 && command2 && exit

In(case as)your script:

#!/bin/bash
command1
sleep 30
command2
exit

Suffix for the sleep time:

  • s for seconds (the default)
  • m for minutes
  • h for hours
  • d for days
share|improve this answer
    
No need for the && in this script. –  Louis Matthijssen May 15 at 13:58
    
Thanks for hint it's corrected –  TuKsn May 15 at 14:02

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.