From owner-freebsd-questions@FreeBSD.ORG Wed Feb 18 15:55:50 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56BE1106567B for ; Wed, 18 Feb 2009 15:55:50 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id BB2FA8FC0A for ; Wed, 18 Feb 2009 15:55:49 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from lack-of-gravitas.thebunker.net (gateway.ash.thebunker.net [213.129.64.4]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n1IFtZP2094424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Feb 2009 15:55:44 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.1 smtp.infracaninophile.co.uk n1IFtZP2094424 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1234972544; bh=pIIQcERl11lGZ8J2ny7s9/Sgm2mEHINTYZwtY2bXSfU=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding:Cc:Content-Type: Date:From:In-Reply-To:Message-ID:Mime-Version:References:To; z=Message-ID:=20<499C2F76.30507@infracaninophile.co.uk>|Date:=20Wed ,=2018=20Feb=202009=2015:55:34=20+0000|From:=20Matthew=20Seaman=20 |Organization:=20Infracaninophile |User-Agent:=20Thunderbird=202.0.0.19=20(X11/20090125)|MIME-Versio n:=201.0|To:=20GESBBB=20|CC:=20FreeBSD=20Users=2 0Questions=20|Subject:=20Re:=20Prob lem=20with=20BASH=20and=20[=20!=20-t=200=20]=20test.|References:=2 0<502804.7096.qm@web32108.mail.mud.yahoo.com>|In-Reply-To:=20<5028 04.7096.qm@web32108.mail.mud.yahoo.com>|X-Enigmail-Version:=200.95 .6|Content-Type:=20text/plain=3B=20charset=3DUTF-8=3B=20format=3Df lowed|Content-Transfer-Encoding:=207bit; b=oLg2rkUuVOH0I5lyFEADbzoSuCHRWU8mqOXYP83D1+BcVN28/zM+BxUzBXeLyAa/f qplR+pSQ7lP000G/QsqQDBcxcG0BY5z+BC2K9R4vidSYkbqRfe40kIifPd/pYDYK7/ sIjZFsMGG+4lqP3y1pmASmYRaqoPSzkE9UzVOo3M= Message-ID: <499C2F76.30507@infracaninophile.co.uk> Date: Wed, 18 Feb 2009 15:55:34 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.19 (X11/20090125) MIME-Version: 1.0 To: GESBBB References: <502804.7096.qm@web32108.mail.mud.yahoo.com> In-Reply-To: <502804.7096.qm@web32108.mail.mud.yahoo.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (smtp.infracaninophile.co.uk [81.187.76.162]); Wed, 18 Feb 2009 15:55:44 +0000 (GMT) X-Virus-Scanned: ClamAV 0.94.2/9002/Wed Feb 18 11:16:50 2009 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,SPF_FAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: FreeBSD Users Questions Subject: Re: Problem with BASH and [ ! -t 0 ] test. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:55:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 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 & 32767 | RESTING=$((RANDOM/60)) | sleep ${RESTING} | fi | | | | 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-----