From owner-freebsd-questions@FreeBSD.ORG Wed Aug 29 21:56:51 2007 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 1A52816A418 for ; Wed, 29 Aug 2007 21:56:51 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 851E413C46B for ; Wed, 29 Aug 2007 21:56:50 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup181.ach.sch.gr [81.186.70.181]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-8) with ESMTP id l7TLuY4P022562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 30 Aug 2007 00:56:43 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l7TLu22n001912; Thu, 30 Aug 2007 00:56:06 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l7TLtV93001891; Thu, 30 Aug 2007 00:55:31 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 30 Aug 2007 00:55:31 +0300 From: Giorgos Keramidas To: Eric Crist Message-ID: <20070829215531.GA1641@kobe.laptop> References: <01a901c7ea3d$0ad62720$1e00a8c0@cheqsoft.local> <20070829185012.A14865@wojtek.tensor.gdynia.pl> <20070829185450.GA15895@kobe.laptop> <14ECFF9B-9559-4B45-B44B-8E030597B00C@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14ECFF9B-9559-4B45-B44B-8E030597B00C@gmail.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.862, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.54, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Wojciech Puchar , freebsd-questions@freebsd.org, Hinkie Subject: Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up) 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, 29 Aug 2007 21:56:51 -0000 On 2007-08-29 14:18, Eric Crist wrote: >On Aug 29, 2007, at 1:54 PMAug 29, 2007, Giorgos Keramidas wrote: >> On 2007-08-29 18:51, Wojciech Puchar >> wrote: >>> fragment from my test program (used for other thing but doesn't matter) >>> >>> /sbin/ping -i 0.5 -s 1450 -c 3 tested_host >/dev/null 2>/dev/null >>> if [ $? != 0 ];then >>> perform_action_if_doesnt_ping >>> fi >> >> I'm not sure if '!=' is a 'portable' way to write sh(1) tests, >> but you have a point there :-) > > AFAIK, the != is evaluated by test, not sh. You're right. I did check with SUSv2 and SUSv3 after I posted the previous message. The != operator is defined by both standards[1,2], so I was wrong about its portability. [1] http://www.opengroup.org/onlinepubs/007908799/xcu/test.html [2] http://www.opengroup.org/onlinepubs/009695399/utilities/test.html Thanks for the correction, Giorgos