-
-
Save hasanmohdkhan/824def52fbc46f470044e7ad23ba4f69 to your computer and use it in GitHub Desktop.
Revisions
-
kongchen revised this gist
Sep 29, 2013 . 1 changed file with 3 additions and 0 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 @@ -1,3 +1,5 @@ #!/bin/bash ############################ #script function ############################ @@ -6,4 +8,5 @@ setProperty(){ mv $3.tmp $3 } ############################ ### usage: setProperty $key $value $filename setProperty "store.folder" "/opt/current/store" "env.properties" -
kongchen created this gist
Sep 29, 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,9 @@ ############################ #script function ############################ setProperty(){ awk -v pat="^$1=" -v value="$1=$2" '{ if ($0 ~ pat) print value; else print $0; }' $3 > $3.tmp mv $3.tmp $3 } ############################ setProperty "store.folder" "/opt/current/store" "env.properties"