Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2009 07:18:03 -0800 (PST)
From:      GESBBB <gesbbb@yahoo.com>
To:        FreeBSD Users Questions <freebsd-questions@freebsd.org>
Subject:   Problem with BASH and [ ! -t 0 ] test.
Message-ID:  <502804.7096.qm@web32108.mail.mud.yahoo.com>

index | next in thread | raw e-mail

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.
 
-- 
Gerard
gesbbb@yahoo.com


help

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