Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-22 Thread Karl Vogel
In a previous message, ges...@yahoo.com wrote: G I am using this snippet of code in a bash script that is run via CRON. G G # See if we are running via CRON G if [ ! -t 0 ] ... G G It runs fine from the console; however, when run via CRON, it outputs Tput: G No terminal type specified and

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread Matthew Seaman
-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

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread Warren Block
On Wed, 18 Feb 2009, 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))    

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread Mel
On Wednesday 18 February 2009 10:40:47 Warren Block wrote: On Wed, 18 Feb 2009, 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

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread GESBBB
From: Matthew Seaman m.sea...@infracaninophile.co.uk GESBBB wrote: | I am using this snippet of code in a bash script that is run via CRON. | | | | # See if we are running via CRON |    if [ ! -t 0 ] |      then | # Use the BASH RANDOM function to generate a random number between 0

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread Chuck Swiger
On Feb 18, 2009, at 12:29 PM, GESBBB wrote: I am a little confused. I believe the problem is with the if [ ! -t 0 ] statement. I tried to redirect the error message; however, it still appears in the email sent by CRON. I tried using this statement instead: if ( ! tty -s /dev/null ) and if

Re: Problem with BASH and [ ! -t 0 ] test.

2009-02-18 Thread Jonathan Chen
On Wed, Feb 18, 2009 at 07:18:03AM -0800, 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 ???