Handling control characters on the command line: Difference between revisions

From RoggeWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
Line 11: Line 11:
==Control-V==
==Control-V==


Use Control-V to insert control codes.  
Use Control-V to insert control codes. This works for the shell and vi.
  [ctrl-v][esc]
  [ctrl-v][esc]
  [ctrl-v][ctrl-m]
  [ctrl-v][ctrl-m]

Latest revision as of 16:33, 9 October 2010


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]