Date: Wed, 18 Feb 2009 15:55:34 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: GESBBB <gesbbb@yahoo.com> Cc: FreeBSD Users Questions <freebsd-questions@freebsd.org> Subject: Re: Problem with BASH and [ ! -t 0 ] test. Message-ID: <499C2F76.30507@infracaninophile.co.uk> In-Reply-To: <502804.7096.qm@web32108.mail.mud.yahoo.com> References: <502804.7096.qm@web32108.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
GESBBB wrote:
| I am using this snippet of code in a bash script that is run via CRON.
|
|
| <snippet>
| # See if we are running via CRON
| if [ ! -t 0 ]
| then
| # Use the BASH RANDOM function to generate a random number between 0 & 32767
| RESTING=$((RANDOM/60))
| sleep ${RESTING}
| fi
| </snippet>
|
|
| It runs fine from the console; however, when run via CRON, it outputs
this error message.
|
| Tput: No terminal type specified and no TERM environmental variable.
|
| I have Googled about, yet I cannot find an answer. Perhaps some Bash
guru can assist me.
|
jot -r 1 0 546
Cheers,
Matthew
- --
Dr Matthew J Seaman MA, D.Phil. Flat 3
~ 7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
~ Kent, CT11 9PW, UK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEAREDAAYFAkmcL3YACgkQ8Mjk52CukIxn9ACePfwIwfNo1q1Sp6zPm9zDB4fh
uhcAnjskxg142o6FeMRNLJwrIMZwJFGi
=VPTj
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?499C2F76.30507>
