【问题标题】:Bash: more than one command line substitutionBash:不止一个命令行替换
【发布时间】:2013-10-04 17:58:45
【问题描述】:
$touch file{1,2}
$echo "file1" >>  file1
$^1^2
=>echo "file2">>file1

但我希望它是这样的

echo "file2">>file2

如何进行多个替换?

【问题讨论】:

标签: bash terminal command-line-arguments


【解决方案1】:
!!:gs/1/2

应该这样做。 ^1^2!!:s/1/2 的快捷方式,您只需提供g 标志。

【讨论】:

  • @VihaanVerma 按照建议尝试**。说!!:gs/1/2!!:as/1/2
猜你喜欢
  • 1970-01-01
  • 2017-01-29
  • 1970-01-01
  • 2017-04-09
  • 2012-02-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多