2013-09-28 152 views
2
$touch file{1,2} 
$echo "file1" >> file1 
$^1^2 
=>echo "file2">>file1 

但我想它是擊:不止一個命令行替換

echo "file2">>file2 

如何做的比一個替代嗎?

+0

同樣的問題已發佈在http://superuser.com/questions/651535/bash-more-than-one-command-line-substitution – devnull

回答

2
!!:gs/1/2 

應該這樣做。 ^1^2!!:s/1/2的快捷方式,您只需提供g標誌即可。

+0

我試過'$^1^2; !!',它沒有工作。謝謝 –

+0

@VihaanVerma按建議**嘗試**。說'!!:gs/1/2'或'!!:as/1/2'。 – devnull