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

Re: locales problem / grep question



On Wed, Mar 19, 2003 at 01:04:59PM -0500, Matt Price wrote:
> if I run emacs -nw, the error doesn't occur, so I asusme the issue is
> x-specific.  Anyway, though people were sympathetic, no one seemed to
> have seen this specific problem before (if it's familiar, help would
> still be absolutely welcome!)...  it's been bugging me on and off, and
> today I tried to use grep to look for this string somewhere in some
> file on the system.  
> 
> now obviously the following doesn't work: 
> grep -r -*-*-medium-r-normal--14-*-*-*-c-*-iso8859-15 /
> (*'s need to be escaped)
> 
> slightly less obviously, neither does this:
> grep -r -\*-\*-medium-r-normal--14-\*-\*-\*-c-\*-iso8859 / 
> (grep looks for a switch after the '-')
> 
> and neither did this, which I tried more or less at random: 
> grep -r \-\*-\*-medium-r-normal--14-\*-\*-\*-c-\*-iso8859 /

That last doesn't work because the shell turns \- into - before grep
sees it, but it's grep that cares about switches, not the shell. Try
this:

  grep -r -- -\*-\*-medium-r-normal--14-\*-\*-\*-c-\*-iso8859 /

... or, perhaps more conveniently:

  grep -r -- '-*-*-medium-r-normal--14-*-*-*-c-*-iso8859' /

The '--' signifies "end of options" to many (but not all) option
parsers. Since programs are responsible for handling options themselves,
they aren't always consistent. It should work for all GNU packages
though.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: