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 -->
  #2 (permalink)  
Old 11-19-2008
mailme0712 mailme0712 is offline
Registered User
  
 

Join Date: Sep 2008
Location: Chennai,India
Posts: 13
using find command followed by if condition

Hi try this

file=`find dirpath -type f -name "filename" -exec grep 06 {} \;`

if [ "$file" = "" ] ; then
var=0
else
var=1
fi

Last edited by mailme0712; 11-19-2008 at 05:04 AM..