Need some grep RE help

Jerry Davis jdawgaz at cox.net
Sat Jun 10 13:55:02 MST 2006


On Sat, 10 Jun 2006 13:28:57 -0700
Dazed_75 <lthielster at gmail.com> wrote:

> There are files that seem to contain a lot of lines seemingly used to
> display information suitable for many locales.  One example is
> ~/.local/share/applications/gconf-editor.desktop.  These would be a
> lot easier to explore if I could look at them and not see the lines
> for locales other than my language.
> 
> My thought was to do a cat foofile | grep regexpl where regexpl would
> pass all lines having no [*] term unless it were [en*].
> Unfortunately, I have forgotten much of what I once knew about
> regular expressions.  I know I want to relearn, but not today.  A
> little help please?

you can do this:

awk '$0 !~ /\[/ { print $0 }; $0 ~ /\[en/ { print $0 }' /path/to/file


> 
> -- 
> "The liberties of a people never were, nor ever will be, secure, when
> the transactions of their rulers may be concealed from them."
> 
> Patrick Henry quote


-- 
Hobbit Name: Pimpernel Loamsdown
Registered Linux User: 275424
 
This email's random fortune: Pryor's Observation:
	How long you live has nothing to do 
	with how long you are going to be dead.


More information about the PLUG-discuss mailing list