[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Looking for a command... - My solution...
Well, I couldn't find something that satisfied all my requirements, so
I just wrote it myself. I originally sent out an email with the tarball
attached because it was only 3k big, but I think the list ignored it
(and rightly so...). So here it is available for download:
I originally wrote a script like the one discussed on this list, but it
had the problem that every command took the full 60 seconds, instead of
terminating if a command finished in less than 60 seconds. That was
fixed by writing a pair of scripts that killed each other and so on...
This solution had the problem of displaying some extraneous output that
I couldn't figure out how to suppress. So, I just decided to write my
own program in C.
Any who, the tarball is available at the link above. Use this in any
way you like. If you see a bug, I'd love to hear about it. It is pretty
straightforward code and would probably be a good example of handling
signals and forking processes in C.
On Fri, 2005-04-01 at 19:12 -0600, email@example.com wrote:
> KDE users have a nice GUI dialog with a timeout feature.
> kdialog --help
> There is also whiptail which looks like a curses-based implementation of kdialog.
> The proper way to do what you want from the shell directly is via signals
> and use of the 'trap' command and 'wait' commands with forking your alarm.
> In Perl, this is trivial to hook into SIGALRM.
> To unsubscribe, send email to firstname.lastname@example.org with
> "unsubscribe silug-discuss" in the body.
To unsubscribe, send email to email@example.com with
"unsubscribe silug-discuss" in the body.