History Substitution: Examples #1

  • Add a missing last character, a "c": !!c
    % lpr /usr/local/src/foo/file.
    lpr: /usr/local/src/foo/file.: file not found
    % !!c
    lpr /usr/local/src/foo/file.c
  • Delete an extra character, a "c": ^c
    % emaccs foofile
    emaccs: command not found
    % ^c
    emacs foofile
  • "A while ago, I edited four files with vi. I'll print the second and third files."
    % lpr !vi:2-3
    lpr somefile.html otherfile.html
< previous  index  next >

Contact Jerry Peek