Last active
November 10, 2024 05:05
-
-
Save nateflink/5793139 to your computer and use it in GitHub Desktop.
Revisions
-
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ FIND=$2 REPLACE=$3 if [ ! -d "${DIRPATH}" ]; then echo "Error: ${DIRPATH} doesn't exist" exit 2 -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,9 @@ if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then exit 1 fi DIRPATH=$1 FIND=$2 REPLACE=$3 if [ -d "${DIRPATH}" ]; -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,5 +18,5 @@ exit 2 fi #sed -i "" is needed by the osx version of sed (instead of sed -i) find ${DIRPATH} -type f | xargs sed -i "" "s|${FIND}|${REPLACE}|g" exit 0 -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $FIND=$2 $REPLACE=$3 if [ -d "${DIRPATH}" ]; then echo "Error: ${DIRPATH} doesn't exist" exit 2 -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,5 +18,5 @@ exit 2 fi #sed -i "" is needed by the osx version of sed (instead of sed -i) find "${DIRPATH}" -type f | xargs sed -i "" "s|${FIND}|${REPLACE}|g" exit 0 -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,17 +6,17 @@ if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then exit 1 fi $DIRPATH=$1 $FIND=$2 $REPLACE=$3 if [ -d ${PATH} ]; then echo "Error: ${DIRPATH} doesn't exist" exit 2 fi #sed -i "" is needed by the osx version of sed (instead of sed -i) find ${DIRPATH} -type f | xargs sed -i "" "s|${FIND}|${REPLACE}|g" exit 0 -
nateflink revised this gist
Jun 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ $REPLACE=$3 if [ -d ${PATH} ]; then echo "Error: ${PATH} doesn't exist" exit 2 fi -
nateflink created this gist
Jun 16, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash #By Nate Flink if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then echo "Usage: ./$0 [path to files] [find string] [replace string]" exit 1 fi $PATH=$1 $FIND=$2 $REPLACE=$3 if [ -d ${PATH} ]; then echo "error: ${PATH} doesn't exist" exit 2 fi #sed -i "" is needed by the osx version of sed (instead of sed -i) find ${PATH} -type f | xargs sed -i "" "s|${FIND}|${REPLACE}|g" exit 0