タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

shellに関するareyoukickingのブックマーク (1)

  • 再帰的に置換 - cotricover

    カレントディレクトリにあるすべてのファイルに置換コマンドを通したいときがある。サブディレクトリも再帰的に処理したい。 そういうときのために。 シェルスクリプトでやってみる。 参考URL:http://www.shido.info/misc/misc.php?id=29 #!/bin/sh function recursiveReplace { for file in `ls $1`; do if [ $0 != ${file} ] && [ "tmp" != ${file} ]; then FULLPATH=${1}/${file} if [ -f ${FULLPATH} ]; then cp ${FULLPATH} ./tmp; tr $2 $3 < ./tmp > ${FULLPATH} elif [ -d ${FULLPATH} ]; then recursiveReplace ${

    再帰的に置換 - cotricover
  • 1