在shell腳本里,將字符串轉ASCII碼的方法:
[keysystem@localhost ~]$ printf "%d" "'A" 65
[keysystem@localhost ~]$ printf "%d" "'0" 48
在shell腳本里,將字符串轉10進制轉16進制的方法:
[keysystem@localhost ~]$ printf "%x" 10 a
printf更多用法參考:http://man.linuxde.net/printf
在shell腳本里,將字符串轉ASCII碼的方法:
[keysystem@localhost ~]$ printf "%d" "'A" 65
[keysystem@localhost ~]$ printf "%d" "'0" 48
在shell腳本里,將字符串轉10進制轉16進制的方法:
[keysystem@localhost ~]$ printf "%x" 10 a
printf更多用法參考:http://man.linuxde.net/printf
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。