dickrong 发表于 2018-8-21 06:15:26

shell 编程备忘

一、设置调试选项 set -x  二、tr命令
  temp.txt 内容:aaaabcdfdfdfdasa
  >cat temp.txt | tr"" ""
  >AAAAbcdfdfdfdAsA
  >cat temp.txt | tr-s ""
  >abcdfdfdfdasa
  >cat temp.txt | tr-d ""
  >bcdddds
  三、变量赋值
  answer=`echo $answer | tr `
  answer=`echo $answer | tr "" ""`

页: [1]
查看完整版本: shell 编程备忘