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.

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

1 Answer 1

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

#!/bin/bash
interval=$(( ($RANDOM % 5) + 1))
sleep ${interval}m
(pidgin) &
exit

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

 
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.