Scripts


Multiple Search & Replace (recursive)

 #!/usr/bin/sh
 
 if [ $# -lt 3 ] ; then
   echo -e "Wrong number of parameters."
   echo -e "Usage:"
   echo -e " $0 'filepattern' 'search' 'replace'"
   exit 1
 fi
 
 find ./ -type f -name $1 -exec sed -i "s/$2/$3/" {} \;
 

Backup of MySql database, suitable for cron job

This will email the database to the person specified. Suitable to throw into a cron job and let it run once a week.

echo "Subject: MySql backup: `date`" > meckfil ; /bin/mysqldump --add-drop-table -h `/bin/mysqlbackups database | head -1` -uusername -ppassword database >> meckfil ; mail rocky@somedomainatsomeplacesomwhere.com < meckfil; rm meckfil



How to contact me
Welcome to
www.Edlin.org
Computing, CS links
Design Patterns
Distribution process
CVS, Backupscript for CVS
Perl tips, Perl links
DHTML/JavaScript/etc
Searchengines
My Bookmarklets
Nostalgia: Atari ST
HP Bluestone
Other stuff
Science Ficton/Fantasy
My Book Reviews
Author: Tom Holt
Bestselling books, May 2005
John Cleese
and much more ....
Contact