[Chicago-talk] Regex question

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


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

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

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?


More information about the Chicago-talk mailing list