Reputation: 13143
$touch file{1,2}
$echo "file1" >> file1
$^1^2
=>echo "file2">>file1
But I wanted it to be
echo "file2">>file2
How to do more than one substitution ?
Upvotes: 2
Views: 75
Reputation: 212464
!!:gs/1/2
should do it. ^1^2
is a shortcut for !!:s/1/2
, and you just need to supply the g
flag.
Upvotes: 2