Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

awk reg-exp question



On Wed, 28 Jan 2004, Duane Morin wrote:

> 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>

Useless Use Of cat. 

How about this instead?

    sed -e s/#\.\*// file | awk ...

But I don't understand your pattern: it matches a pound sign, followed by
a literal '.' character, then a literal asterisk. Why? If you drop the
backslashes, it matches a pound sign followed by zero or more of anything,
which I think is closer to your intent. 


> 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.


Ahh :)



-- 
Chris Devers





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org