Re: When is the next PR update due?
- From: darnel <Sandy.Pittendrigh@xxxxxxxxx>
- Date: 18 Apr 2007 02:33:15 -0700
$to = pop @ARGV;
$from = pop @ARGV;
....be careful with this script. It writes back over top the files
it operates on. Backup your directory tree first:
tar -cvzf saved.tgz your_chosen_directory
or change the first line of the script.
#!/usr/bin/perl -i .....the minus i switch (-i)
tells perl to write back over top the files it
operates on (instead of writing to stdout)
If you use -i.bak as the switch,
perl will save all the original copies as file.bak
before changing file.
Another way is to eliminate the -i switch entirely
Then the sh command becomes:
for file in `find . -name "*\.html"`
rrepstr $file > /tmp/$file
cp /tmp/$file $file
now you have a copy of the original, unchanged file
in /tmp, and the changed file sitting where it was
In another post I showed how to change underscores
to dashes in the file names, rather than the file contents.
That's important too. And trickier.
rrepstr will change any character to any other.
It doesn't have to be underscores and dashes.
- Prev by Date: Google not indexing pages
- Next by Date: (Job) Search Media Analyst - Microsoft
- Previous by thread: Re: When is the next PR update due?
- Next by thread: Re: When is the next PR update due?