[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fw: grep recursive problem
From: |
Ralf Wildenhues |
Subject: |
Re: Fw: grep recursive problem |
Date: |
Thu, 19 Oct 2006 20:56:46 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
* dan1 wrote on Thu, Oct 19, 2006 at 03:04:26PM CEST:
>
> I am trying to find text in some files and it works fine when I type
> the following command from inside the directory where the file
> contains the text searched for: grep -r -i i80word *.php
>
> However if I go one directory up and type the same command, there is
> no result at all, like if the '-r' otion would not be taken into
> account. I tried --recursive but the result is the same.
Your problem has nothing to do with grep. Please learn what shell
globbing is. Basically your shell expands `*.php' to
a-file.php another-file.php ...
before handing that list over to the grep command. Now, if you type
that same command a directory up, grep will only examine those files
that match the pattern `*.php' in _that_ directory, or recurse directories
whose name matches `*.php'. Of which there are likely none.
Try
grep -r -i i80word .
Hope that helps,
Ralf
Re: Fw: grep recursive problem, Eli Zaretskii, 2006/10/20