awk reg-exp question

Duane Morin dmorin at morinfamily.com
Wed Jan 28 15:12:27 EST 2004


On Wed, 2004-01-28 at 15:04, Joshua Pollak wrote:
> #PARAM=wrong_value
> PARAM=value_new # value_old
> 

So basically you want a rule that says "Start with a line, hack off
anything after the #, then do your rule."  Try this:

cat file | sed -e s/#\.\*// | <awk script>

For the first case sed will return a blank line, which should not match
your awk pattern and thus not do anything.

Modify that sed line depending on how you prefer to call it, what shell,
and so forth.  I can never remember what chars I am obligated to escape.

Duane

> ?
> 
> Thanks for the help,
> 
> -Josh




More information about the Discuss mailing list