How to make a bash script wait and then continue running?

1

I have an .sh script. I would like to wait 25 minutes and then continue running, NOT repeat.
It's something like this:

#!/bin/bash
/bin/bash ~/path/script.sh

I want it to kill a process after waiting 25 minutes.

#Wait 25 minutes
killall process

QuyNguyen2013

Posted 2014-07-28T17:30:19.900

Reputation: 499

Answers

3

Use the sleep command: sleep 25m

So it would look like

sleep 25m
killall process

Source and good resource: http://www.cyberciti.biz/faq/linux-unix-sleep-bash-scripting/

tbenz9

Posted 2014-07-28T17:30:19.900

Reputation: 5 868

0

Try: sleep 25m

This should make the script sleep for 25 minutes and then continuing executing after

For sleeping in second try: sleep 25

This will make it sleep for 25 seconds

Dan Smith

Posted 2014-07-28T17:30:19.900

Reputation: 573