extchg.sh

来自「Mysql数据库的web管理工具」· Shell 代码 · 共 42 行

SH
42
字号
#!/bin/sh# original php3->phtml converter by Pavel Piankov <pashah@spb.sitek.net># modified by Tobias Ratschiller to allow any file extension# part of the phpMyAdmin distribution <http://phpwizard.net/phpMyAdmin>if [$1 eq ""]then  echo "Missing first parameter (extension to be changed)"  echo "Usage: extchg <extension to change from> <extension to change to>"  exitfiif [$2 eq ""]then  echo "Missing second parameter (extension to change to)"  echo "Usage: extchg <extension to change from> <extension to change to>"  exitfiif test ! -s *.$1then  echo 'Nothing to convert! Try to copy the script to the directory where you have files to convert.'   exitfiif  test ! -d bakthen	mkdir bakelse	echo 'Directory bak is already there - will try to use it to backup your files...'fifor i in *.$1	 do 	 sed -e 's/'$1'/'$2'/g' $i > `ls $i|sed -e 's/'$1'/'$2'/g'`	 mv $i bak/$i	done;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?