On 21-Feb-2010, at 01:07, steve harley wrote:

On 2010-02-20 22:45 , LuKreme wrote:
I'd like to know where, if anywhere, this maps to the physical disk.
Basically, before I run a script, I want to know that the machine I am
trying to access is actually available.

this should work:

if ping -o cerebus.local ; then
 # run mail script here
fi

Yes, but that floods console.log with either errors "ping: cannot resolve cerebus.local: Unknown Host" or with the 5 line output of ping.

Even with -q, the output of ping is 4 lines, not much better.

I suppose I can redirect standard output to /dev/null, then it will only be the errors that get written to Console. However, I doubt I can redirect both standard out and standard error and still have it work.

Hmm. Interesting,

 if ping -o cerebus.local > /dev/null 2>&1 ; then

Seems to work.

--
What is best in life? To crush your enemies, see them driven before you,
and to hear the lamentation of the women

_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to