$touch file{1,2}
$echo "file1" >> file1
$^1^2
=>echo "file2">>file1
但我想要它是
echo "file2">>file2
如何进行多次替换?
最佳答案
!!:gs/1/2
应该这样做。 ^1^2
是 !!:s/1/2
的快捷方式,您只需提供 g
标志。
关于Bash:多个命令行替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19067670/