VirtualTam's bookmarks

  1. The format of here-documents is:

    1[n]<<[-]word
    2        here-document
    3delimiter
    

    If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded.

    This is useful to write scripts that:

    • write scripts (verbatim)
    • execute a sequence of commands (verbatim) on a remote host
  2. 1# GNU sed
    2sed -e 's/\x1b\[[0-9;]*m//g'
    3
    4# macOS
    5sed -e $'s/\x1b\[[0-9;]*m//g'