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, an "s": ^s
    % emacss foofile
    emacss: command not found
    % ^s
    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