The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-27-2007
convenientstore convenientstore is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 42
basic shell scripting question

If I did indeed grep something out of it, why woudln't $result show nothing?
When I do $? , it does show success...

What is the proper syntax so that $result shows actual thing it's grepping out?

result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`

#echo $result
#
#echo $?
#0