首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

bash shell notes

2013-02-06 
bash shell notes:#!/bin/bashconfig_filexxxxxtmp_file/tmp/tempfile.$$function usage(){cat !usa

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

?

热点排行