history: Modifiers

1 
1 1.1.3 Modifiers
1 ---------------
1 
1 After the optional word designator, you can add a sequence of one or
1 more of the following modifiers, each preceded by a ':'.
1 
1 'h'
1      Remove a trailing pathname component, leaving only the head.
1 
1 't'
1      Remove all leading pathname components, leaving the tail.
1 
1 'r'
1      Remove a trailing suffix of the form '.SUFFIX', leaving the
1      basename.
1 
1 'e'
1      Remove all but the trailing suffix.
1 
1 'p'
1      Print the new command but do not execute it.
1 
1 's/OLD/NEW/'
1      Substitute NEW for the first occurrence of OLD in the event line.
1      Any delimiter may be used in place of '/'.  The delimiter may be
1      quoted in OLD and NEW with a single backslash.  If '&' appears in
1      NEW, it is replaced by OLD.  A single backslash will quote the '&'.
1      The final delimiter is optional if it is the last character on the
1      input line.
1 
1 '&'
1      Repeat the previous substitution.
1 
1 'g'
1 'a'
1      Cause changes to be applied over the entire event line.  Used in
1      conjunction with 's', as in 'gs/OLD/NEW/', or with '&'.
1 
1 'G'
1      Apply the following 's' modifier once to each word in the event.
1