一个shell中字符串替换的小技巧

    技术2022-05-11  50

    用replace,它是mysql附带的。 用法(匹配以比较长为准则): replace from  to  [from to] ...  -- 文件1 文件2 --后边的文件列表也可能改成标准输入 例如: stlxv@stlxvcomputer:~ / workspace / DuniyaSystem / gui / vm $   echo   " clash "  |  replace   " h "   " cc "  clascc 所以可以很容易写出这样的命令,类似DOS中的copy class.*.h class.*.cc: for  x in `ls  class .*. h`;  do      cp  $x  ` echo   $x   |  replace h cc`;  done

    最新回复(0)