SHELL printf Format Directives中有一项是:\NNN character with octal value NNN (1 to 3 digits) "NNN"是个三位数字表示的八进制数, 如:八进制数101表示十进制数65,如下 printf "\101\n"会打印出字符A, 这个命令的功能就是打印出ASCII码为八进制数101的字符。 --------------------------------------------------------------------------------------------------- administrator@ubuntu:/bin$ printf "\101\n" --------------------------------------------------------------------------------------------------- 要打印出128以上的字符需要设置终端的编码,如设为ISO-8859-15就可以看到打印出的字符: --------------------------------------------------------------------------------------------------- administrator@ubuntu:/home$ printf "\302\n" ---------------------------------------------------------------------------------------------------- ASCII Table and DescriptionASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'
Extended ASCII Codes |
SHELL printf octal value
最新推荐文章于 2024-10-09 17:52:59 发布