Handling control characters on the command line: Difference between revisions

From RoggeWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
  printf '\033'"\n" | cat -vet -
  printf '\033'"\n" | cat -vet -
  printf '\x0d'"\n" | cat -vet -
  printf '\x0d'"\n" | cat -vet -
[ctrl-v][esc]
[ctrl-v][ctrl-m]


  printf '[ctrl-v][ctrl-m]' | cat -vet -; echo
  printf '[ctrl-v][ctrl-m]' | cat -vet -; echo
Line 14: 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][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]