Jeff Abrahamson on Wed, 8 Jan 2003 13:00:50 -0500 |
On Wed, Jan 08, 2003 at 12:46:34PM -0500, Urb LeJeune wrote: > Is it possible for a Perl script to detect if it's running as a > background task? If running from the command line I want to > display progress messages, if running as a cron job I don't want > to print. I could pass a parameter when running as a cron job but > wanted to see if there was an easier way. isatty(STDOUT) Your spelling may vary, answer provided in the hopes that a fast approximate answer is worth something. This will also detect writing to a pipe. What does background mean on unix? That's rhetorical. -- Jeff Jeff Abrahamson <http://www.purple.com/jeff/> GPG fingerprint: 1A1A BA95 D082 A558 A276 63C6 16BF 8C4C 0D1D AE4B - **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|