Thứ Ba, 10 tháng 2, 2015

Linux / UNIX: Bash Script Sleep or Delay a Specified Amount of Time

Linux / UNIX: Bash Script Sleep or Delay a Specified Amount of Time

How do I pause for 5 seconds or 2 minutes in my bash shell script on a Linux or Unix-like systems?

You need to use the sleep command to add delay for a specified amount of time. The syntax is as follows for gnu/bash sleep command:

sleep NUMBER[SUFFIX]


Where SUFFIX may be:

s for seconds (the default)

m for minutes.

h for hours.

d for days.

Không có nhận xét nào:

Đăng nhận xét