bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[grep] Searching with star and files with a name starting with a dash


From: Pierre Morin
Subject: [grep] Searching with star and files with a name starting with a dash
Date: Tue, 25 May 2010 16:50:54 +0200

Hello.

I think I found a "bug" with grep in the way I use it.
I use grep to search a string recursively on files.

For exemple if I search the string "Unix" in all the files of /etc, I go
under "/etc" in my terminal and then I run the command "grep -r 'Unix'
*".
It runs just fine so far.
But I had the mad idea to name a file with a dash at the beginning of
the name (exemple : "-test").
And there, I can see that the name of the file "-test" is interpreting
by the command as an option.

It's not a real big bug but I think it's strange to have a file name
interpreting as an option of a command.

Here is how to have the bug :
- create a file with name beginning with a dash ("-test" for exemple)
- in the folder containing the file, run the command "grep -r
'WhatEverYouWant" *"

Thanks !

Regards,


-- 
Pierre Morin
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]