MARG wrote: > John W. Krahn wrote: >>MARG wrote: >> >>>I'm trying to change the string in .bash_profile: >>>PATH=$PATH:/home/bin >>> >>>to >>>PATH=$PATH/home/bin:/usr/local/httpd/bin >>> >>>I'm using the following: >>>perl -pi~ -e 's/PATH=$PATH/home/bin/PATH=$PATH/home/bin:/usr/local/httpd/bin >>>' .bash_profile >>> >>>but i'm getting a lot of errors. >>> >>>What might be wrong ? >> >>Because the pattern and replacement string contain the slash (/) character you >>have to use a different delimiter for the substitution operator. Because the >>pattern and replacement string are interpolated $PATH is changed to '' in >>both. >> >>perl -pi~ -e's~^(PATH=\$PATH/home/bin)~$1:/usr/local/httpd/bin~' .bash_profile > > Thank you for your ansewer. > > I don't have any error anymore, but the file remains unchanged :( > > Any ideas ?
Perhaps the pattern was not found? Maybe this will work better: perl -pi~ -e's~(\bPATH=\$PATH/home/bin)~$1:/usr/local/httpd/bin~' .bash_profile John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>