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.


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 &


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.


$ 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.