Re: shell script: How to determine if I'm in the background?
On Wed, 28 Aug 2002 11:12:17 +1000 Wienand Ian
<iwienand@woolworths.com.au> wrote:
> >I'd very much like to hear from anybody who might have faced the same
> >problem and learn of possibly simpler alternative solutions. I
> >enclose the code below.
>
> While an interesting problem to be sure, it seems like a solution
> begging for a question. Why don't you just add an argument flag that
> when present tells your application to go ahead without input, and
> then add that flag to your cron job?
That was the 1st thing I thought of, but it just seems wrong.
1) A user shouldn't be made to memorize one more option for what might well be already option-burdened commands, and a command line like "somescript -background &" just looks plain silly.
2) An awareness of how it is run should make a program much more robust and error-proof. A program being run in the background with full verbosity turned on by user mistake could consume all available disk space on a nearly full machine in a matter of minutes.
--
Carlos Sousa
http://vbc.dyndns.org/
Reply to: