The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 03:44 AM
help me to answer this lo-lp-kl Shell Programming and Scripting 0 05-25-2008 07:45 PM
boolean parameter aya_r Shell Programming and Scripting 0 09-07-2007 12:43 AM
can any one answer ???? mobile01 High Level Programming 2 11-30-2006 09:32 AM
trying to get a boolean response from sed badg3r Shell Programming and Scripting 4 05-30-2006 02:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-12-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
Is there way to ping and return boolean answer?

Hello
im using sunos and i need to somehow ping other sun in the network but
geting boolean return and not the "sun is alive" response can it be done ?
Reply With Quote
Forum Sponsor
  #2  
Old 02-12-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
I think this had been answered already ! ( Not sure, though )

Code:
ping <hostname> 2>/dev/null 1>&2
Now you have the required value in $?
Reply With Quote
  #3  
Old 02-12-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
its giving me the msg
Ambiguous output redirect
Reply With Quote
  #4  
Old 02-12-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
Could you please post the command that you had executed? ( If possible )

We could have a look !!!
Reply With Quote
  #5  
Old 02-12-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
ping sun8 2>/dev/null 1>&2

output
Ambiguous output redirect.
Reply With Quote
  #6  
Old 02-12-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
can i somhow to prevent the output of
ping: unknown host sun?
when the ping failed?

Thanks
Reply With Quote
  #7  
Old 02-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
It complains about the output redirect, which is strange cause it is correct as defined. However you can try changing the redirect.

Instead of:
ping sun8 2>/dev/null 1>&2
try:
ping sun8 >/dev/null 2>&1

if that doesn't work you can try:
ping sun8 > /dev/null 2>/dev/null
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0