Pode ser omitido se for o último caractere da linha do evento.
Primeiro, verificamos que ^string1^string2^
significa man bash
:
^string1^string2^
Quick substitution. Repeat the previous command,
replacing string1 with string2. Equivalent to
''!!:s/string1/string2/'' (see Modifiers below).
Então, é equivalente a s/string1/string2/
. Leia a documentação do modificador s
:
s/old/new/
Substitute new for the first occurrence of old in the event line.
Any delimiter can be used in place of /. The final delimiter
is optional if it is the last character of the event line. The
delimiter may be quoted in old and new with a single backslash.
If & appears in new, it is replaced by old. A single backslash
will quote the &. If old is null, it is set to the last old
substituted, or, if no previous history substitutions took place,
the last string in a !?string[?] search.