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>
next in thread | raw e-mail | index | archive | help
I am using this snippet of code in a bash script that is run via CRON.=0A= =A0=0A=A0=0A<snippet>=0A# See if we are running via CRON=0A=A0=A0=A0 if [ != -t 0 ]=0A=A0=A0=A0=A0=A0 then=0A# Use the BASH RANDOM function to generate= a random number between 0 & 32767=0A=A0=A0=A0=A0=A0=A0=A0 RESTING=3D$((RAN= DOM/60))=0A=A0=A0=A0=A0=A0=A0=A0 sleep ${RESTING}=0A=A0=A0=A0 fi=0A</snippe= t>=0A=A0=0A=A0=0AIt runs fine from the console; however, when run via CRON,= it outputs this error message.=0A=A0=0ATput: No terminal type specified an= d no TERM environmental variable.=0A=A0=0AI have Googled about, yet I canno= t find an answer. Perhaps some Bash guru can assist me.=0A=A0=0A-- =0AGerar= d=0Agesbbb@yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?502804.7096.qm>