History Substitution: Examples #2

  • Repeat a series of commands (repeat third-previous command): !-3
    % vi somefile.c
    % ci -l -m"fixed bugs" somefile.c
    % make someprog
    % !-3
    vi somefile.c
    % !-3
    ci -l -m"fixed bugs" somefile.c
    % !-3
    make someprog
    % !-3
    vi somefile.c
    ...
  • Globally substitute anywhere
    % lp file_a2461.c file_b1831.c file_c1900.c ...
    ...later...
    % !lp:gs/.c/.txt/
    lp file_a2461.txt file_b1831.txt file_c1900.txt ...
  • And much more!
< previous  index  next >


Contact Jerry Peek