Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2009 12:40:47 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        GESBBB <gesbbb@yahoo.com>
Cc:        FreeBSD Users Questions <freebsd-questions@freebsd.org>
Subject:   Re: Problem with BASH and [ ! -t 0 ] test.
Message-ID:  <alpine.BSF.2.00.0902181238280.15654@wonkity.com>
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
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1244918271-1234986047=:15654
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

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))
>         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.

cron uses /bin/sh, not bash.

-Warren Block * Rapid City, South Dakota USA
--0-1244918271-1234986047=:15654--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0902181238280.15654>