Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up)

[ Available lists | Index of freebsd-questions | Month of Aug 2007 | Week of 29 Aug 2007 | Raw email | View thread | Wrap long lines | Reply ]
From
Giorgos Keramidas <keramida@ceid.upatras.gr>
Date
29 Aug 2007 21:56:51
Subject
Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up)
Message-ID
20070829215531.GA1641@kobe.laptop

In reply to

[ Hide this part ]
On 2007-08-29 14:18, Eric Crist <mnslinky@gmail.com> wrote:
>On Aug 29, 2007, at 1:54 PMAug 29, 2007, Giorgos Keramidas wrote:
>> On 2007-08-29 18:51, Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
>> 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



Elapsed time: 0.472 seconds