Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Reading 'sleep' mans and googling haven't provide any useful information.

I want to run Pidgin after Ubuntu boots, but after some time left. For example, logon is passed, and after interval for 1 to 5 minutes Pidgin starts. As manuals of 'sleep' says, there a way to specify only number of hours, mins and seconds.

Is there any way/other linux command to solve my problem?

share|improve this question
Why does it have to be a random interval? – Gerhard Burger Dec 7 '12 at 9:23

I don't know why you want it, but you can do what you want with the following bash script:

interval=$(( ($RANDOM % 5) + 1))
sleep ${interval}m
(pidgin) &

It picks a number 1-5 and then sleeps for that many minutes, then starts pidgin in the background and exits the script.

share|improve this answer

Your Answer


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.