In bash, if I run this command:
I get aaaaaaa (duh)
But then if I type in
I end up with baaaaaa
What would I type to end up with bbbbbbb ?
In bash, I don't think you can combine the ^ shortcut with any modifier. That leaves the long form:
In zsh, the G modifier is a special case, you can use it with ^:
^search^replacement is syntactic sugar for !:s/search/replacement/, which is explained in this answer. The version that replaces all instances is !:gs/search/replacement/; I think that's the shortest form there is
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the
terms of service.
1 year ago