home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phptriad / phptriad2-2-1.exe / htdocs / phpmyadmin / scripts / extchg.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2001-08-08  |  656b  |  28 lines

  1. #!/bin/sh
  2.  
  3. # $Id: extchg.sh,v 1.1 2001/08/08 16:25:10 swix Exp $ 
  4.  
  5. # original php3->phtml converter by Pavel Piankov <pashah@spb.sitek.net>
  6. # modified by Tobias Ratschiller to allow any file extension
  7. # part of the phpMyAdmin distribution <http://phpwizard.net/phpMyAdmin>
  8.  
  9. # 2001-07-07, lem9@users.sourceforge.net:
  10. # - supports sub-directories
  11. # - no more bak directory
  12.  
  13. if [ $# != 2 ]
  14. then
  15.   echo "Usage: extchg.sh <extension to change from> <extension to change to>"
  16.   echo ""
  17.   echo "Example: extchg.sh php3 php"
  18.   exit
  19. fi
  20.  
  21. for i in `find . -name "*.$1"`
  22.      do 
  23.      echo $i
  24.      sed -e 's/\.'$1'/\.'$2'/g' $i > `ls $i|sed -e 's/'$1'/'$2'/g'`
  25.      rm $i
  26.     done;
  27.  
  28.