Register
It is currently Wed Apr 23, 2014 12:44 am

suggestion for command to use


All times are UTC - 6 hours


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 PostPosted: Sun Aug 05, 2012 7:18 am   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
I wonder what dummy command i can use as argument to the timeout command in this script. I tried the dummy : command and the system returned an error.
#!/bin/bash
echo "What number of minutes will you spend? >"
read duration ;
timeout "$duration"m : ;
echo -ne "\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a"

because : command returned an error, i decided to use a command that wouldn't necessary be a disturbance but would still be running in "heaven-knows-where" space.
timeout "$duration"m top ;

can anyone suggest a dummy command for the timeout above. I think top is out of place but just an ad-hoc arrangement. tnx


Top
 Profile  
 PostPosted: Sun Aug 05, 2012 10:01 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
hi,

what's the returned error?
what is exctaly supposed to do `timeout`?


Top
 Profile  
 PostPosted: Sun Aug 05, 2012 12:21 pm   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
The returned error is that : is not a command; i believe that was what it was. but the bash ref says it is a built-in that acts as a dummy command that was why i thought it was effective for that task.
what timeout does is do nothing until the $duration minutes inputted by the user expires, then the function alerts the user by ringing a series of bells.


Top
 Profile  
 PostPosted: Sun Aug 05, 2012 5:18 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
/bin/sleep

: is a command that does nothing. as any command it has to be separated from others by a new line, or a semi-colon.


Top
 Profile  
 PostPosted: Mon Aug 06, 2012 1:23 am   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
I am calling it, i.e : , from another command, timeout. timeout fails when it is called.
I'll see if sleep will run with timeout.


Top
 Profile  
 PostPosted: Mon Aug 06, 2012 3:29 am   

Joined: Fri Aug 03, 2012 2:07 pm
Posts: 20
sleep is better.
tnx


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP