sed用得很熟,但在mac上执行出错,奇怪:
~/hehe$ sed -i "s/taojie/taoge/g" `grep -rl taojie .`
sed: 1: "./test.txt": invalid command code .
~/hehe$
~/hehe$
~/hehe$ sed -i "" "s/taojie/taoge/g" `grep -rl taojie .`
~/hehe$
~/hehe$
~/hehe$ cat test.txt
taogeabcdef
~/hehe$
嗯,跟ubuntu有点差别,需要加入""
不多说。