Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find

Status
Not open for further replies.

krava

Programmer
Jun 4, 2007
48
YU
hi

I am trying to manipulate files that contain some of these words

tau1, tau2, tau3, tau4, tau5 or tau6

I wrote this one

for fl in `find -type f -regex '.*tau\(1\|2\|3\|4\|5\|6\).*' -print`; do
echo $fl;
done

and tried this

for fl in `find -regextype posix-egrep -type f -regex '.*tau(1|2|3|4|5|6).*' -print`; do
echo $fl;
done




But both command manipulates files with tau10 as well. How to avoid this?


thanks
p.
 
With legacy shell pattern:
find -type f -name '*tau[1-6][!0-9]*'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top