The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How to search (grep?) filename for a string and if it contains this then...
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How to search (grep?) filename for a string and if it contains this then...
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
11-19-2008
mailme0712
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
..
mailme0712
View Public Profile
Find all posts by mailme0712
Find mailme0712's past nominations received
Find mailme0712's present nominations given