Handling control characters on the command line

From RoggeWiki
Revision as of 16:33, 9 October 2010 by Tom (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


printf

printf '\033'"\n" | cat -vet -
printf '\x0d'"\n" | cat -vet -
printf '[ctrl-v][ctrl-m]' | cat -vet -; echo

Control-V

Use Control-V to insert control codes. This works for the shell and vi.

[ctrl-v][esc]
[ctrl-v][ctrl-m]