Hi all, when I do a "grep JERRY *.h" nothing is returned which is what I expect. This is in my source directory... when I do a "grep JERRY *" every file is returned an a line printed even though there is no JERRY on the line. Then if I do a "grep JERRY *.c" just the 4 lines that have JERRY are returned. This is what is prints for "grep JERRY *" src# grep JERRY * | more grep: JERRY: No such file or directory access_manager_help.htm:<FONT COLOR="#CCCCCC"> </FONT> so why is is skipping JERRY as the search item? The name JERRY is not the problem I can do this with any name and the same happens when searching all file "*". Thanks, Jerry
Jerry Geis wrote:> Hi all, > > when I do a "grep JERRY *.h" nothing is returned which is what I expect. > This is in my source directory... > when I do a "grep JERRY *" every file is returned an a line printed even > though there is no JERRY on the line. > Then if I do a "grep JERRY *.c" just the 4 lines that have JERRY are > returned.Do you have a file name that starts with a "-" in your directory? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Fax: +45 33 27 47 08 Email: mk at crc.dk Homepage: http://www.crc.dk
> > Jerry Geis wrote: > >/ Hi all, > />/ > />/ when I do a "grep JERRY *.h" nothing is returned which is what I expect. > />/ This is in my source directory... > />/ when I do a "grep JERRY *" every file is returned an a line printed even > />/ though there is no JERRY on the line. > />/ Then if I do a "grep JERRY *.c" just the 4 lines that have JERRY are > />/ returned. > / > Do you have a file name that starts with a "-" in your directory? > > MogensYes I do actually. There is a -f filename of which I dont need. I tried rm *f and it is not removing it. No what? Jerry -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080516/c7e0adb7/attachment-0005.html>
> I tried rm *f and it is not removing it. No what?rm -- -f
In article <482D8875.1050709 at pagestation.com>, Jerry Geis <geisj at pagestation.com> wrote:> > Do you have a file name that starts with a "-" in your directory? > > > > Mogens > > Yes I do actually. There is a -f filename of which I dont need. > > I tried rm *f and it is not removing it. No what?Ouch! That may well have deleted any other files with a name ending in f, while leaving the file -f still there! [tony at softins tmp]$ touch ./-f ae af ag be bf bg [tony at softins tmp]$ ls -f ae af ag be bf bg [tony at softins tmp]$ echo *f -f af bf [tony at softins tmp]$ rm *f [tony at softins tmp]$ ls -f ae ag be bg Easiest way to remove the file -f is: rm ./-f Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org