Modifiers (Debugging with GDB)
From Get docs
Gdb/docs/latest/gdb/Modifiers
Previous: Word Designators, Up: History Interaction [Contents][Index]
33.1.3 Modifiers
After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event.
h- Remove a trailing pathname component, leaving only the head.
t- Remove all leading pathname components, leaving the tail.
r- Remove a trailing suffix of the form ‘
.suffix’, leaving the basename. e- Remove all but the trailing suffix.
p- Print the new command but do not execute it.
s/old/new/- Substitute
newfor the first occurrence ofoldin the event line. Any character may be used as the delimiter in place of ‘/’. The delimiter may be quoted inoldandnewwith a single backslash. If ‘&’ appears innew, it is replaced byold. A single backslash will quote the ‘&’. Ifoldis null, it is set to the lastoldsubstituted, or, if no previous history substitutions took place, the laststringin a !?string[?]search. Ifnewis is null, each matchingoldis deleted. The final delimiter is optional if it is the last character on the input line. &- Repeat the previous substitution.
g
a
- Cause changes to be applied over the entire event line. Used in conjunction with ‘
s’, as ings/old/new/, or with ‘&’. G- Apply the following ‘
s’ or ‘&’ modifier once to each word in the event.