SHELL printf octal value


 

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"
A

---------------------------------------------------------------------------------------------------

要打印出128以上的字符需要设置终端的编码,如设为ISO-8859-15就可以看到打印出的字符:

---------------------------------------------------------------------------------------------------

administrator@ubuntu:/home$ printf "\302\n"
Â

----------------------------------------------------------------------------------------------------

ASCII Table and Description

ASCII 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'

 


 

EBCDIC and IBM Scan Codes

Extended ASCII Codes

 Ascii Table


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值