Handling control characters on the command line: Difference between revisions
Jump to navigation
Jump to search
(Created page with 'Category Unix Category Bash ==printf== printf '\033'"\n" | cat -vet - printf '\x0d'"\n" | cat -vet - [ctrl-v][esc] [ctrl-v][ctrl-m] printf '[ctrl-v][ctrl-m]' | cat -v…') |
mNo edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category Unix]] | [[Category:Unix]] | ||
[[Category Bash]] | [[Category:Bash]] | ||
==printf== | ==printf== | ||
printf '\033'"\n" | cat -vet - | printf '\033'"\n" | cat -vet - | ||
printf '\x0d'"\n" | cat -vet - | printf '\x0d'"\n" | cat -vet - | ||
printf '[ctrl-v][ctrl-m]' | cat -vet -; echo | |||
printf '[ctrl-v][ctrl-m]' | cat -vet -; echo | |||
==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]