niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » shell
Get Boolean from ping
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Gnarlodious
*nix forums beginner


Joined: 19 Feb 2005
Posts: 32

PostPosted: Tue Feb 15, 2005 5:24 pm    Post subject: Re: Get Boolean from ping Reply with quote

Entity Chris F.A. Johnson spoke thus:

Quote:
On Tue, 15 Feb 2005 at 16:38 GMT, Gnarlodious wrote:
Is there an easy way to get a binary result from the ping command? I want a
zero or a one.

ping <args> >/dev/null && echo 0 || echo 1

(Or do you want something else?)
Nope, that'll do, thanks!



-- Gnarlie
When you scratch a cynic you find a disappointed idealist underneath
George Carlin
Back to top
Chris F.A. Johnson
*nix forums Guru


Joined: 20 Feb 2005
Posts: 2268

PostPosted: Tue Feb 15, 2005 3:51 pm    Post subject: Re: Get Boolean from ping Reply with quote

On Tue, 15 Feb 2005 at 16:38 GMT, Gnarlodious wrote:
Quote:
Is there an easy way to get a binary result from the ping command? I want a
zero or a one.

ping <args> >/dev/null && echo 0 || echo 1

(Or do you want something else?)

--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
===================================================================
My code (if any) in this post is copyright 2005, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Back to top
Gnarlodious
*nix forums beginner


Joined: 19 Feb 2005
Posts: 32

PostPosted: Tue Feb 15, 2005 3:38 pm    Post subject: Get Boolean from ping Reply with quote

Is there an easy way to get a binary result from the ping command? I want a
zero or a one.

--
Cosmetic Justice; when the Botox gives you Mad Cow Disease
-- Gnarlodious
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 1:06 am | All times are GMT
navigation Forum index » Programming » shell
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Can't ping Christian Christmann Debian 5 Wed Jul 19, 2006 8:30 pm
No new posts Networking Ping Request timed out error littleminxchick@aol.com networking 1 Fri Jul 14, 2006 10:10 pm
No new posts Passing Boolean to a Function Greg Scharlemann PHP 19 Mon Jul 10, 2006 12:01 am
No new posts Boolean Operator question promet C++ 2 Sat Jul 01, 2006 2:14 am
No new posts Ping not working gvelmurugan@gmail.com Solaris 3 Fri Jun 30, 2006 7:54 am

Money News | Mortgages | Fast Loans | Latest Credit Cards | Credit Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 1.2816s ][ Queries: 20 (1.2079s) ][ GZIP on - Debug on ]