How to create ASCII codes 2 and 3 on the Bash command line?

If I press Ctrl+ B, which should give me ASCII 2 code, but Ctrl+ Cwill be interpreted as Break.

So, I suppose I need to redirect the file. How to get these characters to a file?

+3
source share
3 answers

Ctrl- Vleaves the next key. How can you get Ctrl- Cout: Ctrl- V Ctrl-C

+9
source
echo $'\002\003' > ./myfile
+5
source
perl -e 'print "\xFF"'

where FFis the hexadecimal code of the ACSII code you want to print. Therefore, for ACSII 2 code, this will be \ x02.

+1
source

Source: https://habr.com/ru/post/1696441/


All Articles