cvsed.pl - Edit files and rename files. Like
sed(1) and ed(1).
CVS is a concurrent version control system and available for multiple
http://www.cvshome.com. This program will help changing the
content of client files Root, Repository, Entries and Tag. From
time to time there is a need to change the repository locations and this
needs immediate changin in following files:
CVS/Root /cygdrive/g/data/version-control/cvsroot CVS/Repository emacs/gnu-emacs/lisp
CVS/Root /cygdrive/h/data/version-control/cvsroot CVS/Repository emacs/gnu-emacs/lisp
In the above example, the Win32 http://www.cygwin.com/ hard disk repository was changed from disk g (that possibly filled up) to a partition h. Any similar change can be carried out with any of these files. The changes to the files are made using perl code that is evaled and for the above situation the command line parameters would be:
cvsed.pl --name "/Root$" --eval "s,/g/,/h/," .
cvsed.pl --name FILE-REGEXP --eval PERL-CODE DIR [DIR DIR ..]
To move the repository from g disk to h disk for file ``Root'', when the content is ``/cygdrive/g/data/version-control/cvsroot''. With the --test options the program will only print what would happen and no actual changes are made.
cvsed.pl --test --name "/Root$" --eval "s,/g/,/h/," .
Sometimes the server has changes locations (IP) or the repository has otherwise relocated on disk.
CVS/Root file before:
How it sould read:
Now give command
cvsed.pl --test --name "/Root$" \ --eval s,:/cvsroot/,:/cvsroot/new/location/," .
As you may have already noticed, this perl script is not merely for changing the CVS administrative files, but you can use program to change whatever files in your filesystem. Say you want to correct every email in your files from OLD address to NEW address:
cvsed.pl --test --name "\.txt$" --eval 's,\Qmefirstname.lastname@example.org,email@example.com,'
You need the \Q quote operator to take everything literally, because for
at(@) character is special. Remember to use single quotes in
--eval if you add any backslashes, so that everything are passed
<what to check in case of error or weird behavior>
No environment variables used.
No standards referenced.
CPAN entry is at http://cpan.perl.org/modules/by-authors/id/J/JA/JARIAALTO/ Reach author at firstname.lastname@example.org HomePage is at
$Id: cvsed.pl,v 1.1 2002/07/26 20:50:01 jaalto Exp $
Copyright (C) 2001-2002 Jari Aalto. All rights reserved. This program is free software; you can redistribute and/or modify program under the same terms as Perl itself or in terms of Gnu General Public licence v2 or later.