Gentoo Archives: gentoo-user

From: Patrick Holthaus <patrick.holthaus@×××××××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Is grep broken?
Date: Wed, 01 Jul 2009 14:37:25
Message-Id: 25387_1246459040_ZZg0y5H4OmC7y.00_200907011637.19681.patrick.holthaus@uni-bielefeld.de
In Reply to: [gentoo-user] Is grep broken? by Peter Humphrey
1 On Wednesday 01 July 2009 16:30:26 Peter Humphrey wrote:
2 > Hello list,
3 >
4 > Can anyone explain this to me?
5 >
6 > $ /bin/grep -r hmenu *html
7 > index.html: <div id="hmenu">
8 > master.html: <div id="hmenu">
9 > pictures.html: <div id="hmenu">
10
11 The star is evaluated /before/ grep is executed. Therefore, only files that are
12 ending with html are searched recursively. If you had placed the files in a
13 directory called blablahtml, then grep would have searched there.
14
15 > $ /bin/grep -r hmenu pages/*html
16 > pages/community.html: <div id="hmenu">
17 > pages/contacts.html: <div id="hmenu">
18 > pages/history.html: <div id="hmenu">
19 > pages/music.html: <div id="hmenu">
20 > pages/news.html: <div id="hmenu">
21 > pages/people.html: <div id="hmenu">
22 > pages/pictures.html: <div id="hmenu">
23 >
24 > Grep is clearly disobeying the recursion command. I started noticing this a
25 > few days ago, and it's making maintenance of this directory hard work.
26
27 No, you just did not tell it to search in the the directory pages. :)
28
29 HTH
30 Patrick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Is grep broken? Peter Humphrey <peter@××××××××××××××.org>