bash shell notes:
#!/bin/bashconfig_file='xxxxx'tmp_file=/tmp/tempfile.$$function usage(){cat <<!usage: $(basename $0) optionsoptionsaaa switch to aaabbb switch to bbbccc switch to ccc! exit 9}cmd=$1if [ $# -eq 0 ]; then echo Required parameter '"'Environment'"' not set exit 1usage fi if [ "$cmd" = "aaa" ]; then cd ~/test/aaa/ cp $config_file $tmp_file url="xxxxxxxxxxxxxx" sed -i -e s/xxxxxxxxxx=.*/$url/ $tmp_file cp $tmp_file $config_filefi if [ "$cmd" = "bbb" ]; then cd ~/test/bbb/ cp $config_file $tmp_file sed -i -e "s/shouldLogSql = System.properties.containsKey(\"logSql\")/shouldLogSql = true/" $tmp_file cp $tmp_file $config_filefiif [ "$cmd" = "ccc" ]; then cd ~/test/ccc/ cp $config_file $tmp_file if grep "getEnvironment()\.toLowerCase()" $tmp_file; then sed -i -e "s/getEnvironment()\.toLowerCase()/\"apac\"/" $tmp_file fi cp $tmp_file $config_filefi
?