develooper Front page | perl.beginners | Postings from September 2001

Re: Search --> Replace on Unix

Thread Previous | Thread Next
From:
brian d foy
Date:
September 6, 2001 13:46
Subject:
Re: Search --> Replace on Unix
Message ID:
comdog-AD279B.16470006092001@nntp.perl.org
In article <20010906163445-r01010800-a3e28827-0860-0108@192.168.0.2>, 
dowda@coraconnection.com (David Gilden) wrote:

> perl -e 'foreach $file (glob("*")) {grep '../forum_idx.pl' '../cgi-bin/forum_idx.pl');}'

you just want to go through each file and replace those instances?

    perl -pi.old -e "s|../forum_idx.pl|../cgi-bin/forum_idx.pl|g" *

see the perlrun manpage for details on all of the switches.

    http://www.perldoc.com/perl5.6/pod/perlrun.html

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About