[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grep
From: |
Bob Proulx |
Subject: |
Re: Grep |
Date: |
Sun, 18 May 2008 18:07:06 -0600 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
pearls wrote:
> I was trying to do grep -fl <filename1> <filename2>
> it reported an error stating that:
>
> grep: l: No such file or directory
>
> Is it a bug or there is some logical reason behind it.
The -f option takes a filename. The grep documentation says:
grep [options] [-e PATTERN | -f FILE] [FILE...]
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file con‐
tains zero patterns, and therefore matches nothing.
Saying "-fl" is the same as "-f l" says that "l" is a file of
patterns. If there is no such file or directory named "l" in the
current directory to satisfy that option then that is the logical
reason behind it complaining that it cannot be opened.
Bob