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.

I want to make a shortcut that will run utorrent every time i click it without me doing all the commands in terminal every time...

I created a script the run cd my utorrent folder and then do the ./utserver. After that i need to make my firefox open in u torrent link "http://localhost...etc" . But my problem is that ./torrent don't finish for about 2-3 mins although in that time if i manually open the link for u torrent in firefox it starts fine so i need a command that will open this link in firefox after about 4-5 secs even if ./utorrent (command) wasn't finished...

(but not instantly after started because utorrent wont start) does anyone have an idea how can i do this?

Thanks in advance.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Another alternative would be sleep

sleep 360; /path/to/firefox blah blah (or on separate lines if in your script)

Sleep takes an argument in seconds and waits that long before stopping and letting the shell move on. In this case, if this is in your script, make sure you run the script with & after it or your terminal will be blocked until it is done.

./myScript &

And if you want to close your terminal without stopping the script

nohup ./myscript >/dev/null 2>&1 &

share|improve this answer

manpage for at

The at utility shall read commands from standard input and group them together as an at-job, to be executed at a later time.

Example:

$ at 12:49
at> script
at> <EOT>

and at 12:49 "script" is executed (if it is executable ;) ). You can use the -m option to get a notification in your (local) mailbox.

The options you can put behind the at are many (have a look at the manpage).

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.