Wednesday, May 15, 2024
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 42975  / 1 Year ago, thu, january 26, 2023, 10:31:42

I want to do something like following:


#!/bin/bash
command1
<pause for 30 seconds>
command2
exit

How can I do it?


More From » command-line

 Answers
3

You can use this in a terminal:



command1; sleep 30; command2


In 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


[#25200] Thursday, January 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cugure

Total Points: 188
Total Questions: 110
Total Answers: 103

Location: Dominican Republic
Member since Sun, Sep 4, 2022
2 Years ago
;