[Chicago-talk] Regex question

Jay Strauss me at heyjay.com
Sat Mar 19 07:43:45 PST 2005


Hi,

I want to modify the /etc/skel/.bash_profile file, specifically I want 
to uncomment the lines:

...
# include .bashrc if it exists
#if [ -f ~/.bashrc ]; then
#    . ~/.bashrc
#fi
...

Removing the comments. so that when I'm done the rest of the file is 
unchanged but the .bashrc stanza looks like:

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
     . ~/.bashrc
fi


Is there a way to tell a regex to only search & replace between a 
certain match?  Is there a name for this function that I may read about?

thanks
Jay


More information about the Chicago-talk mailing list