在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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-26
  • 2021-05-24
  • 2021-07-14
  • 2022-01-25
  • 2022-02-12
  • 2022-12-23
相关资源
相似解决方案