作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在编写一个 sed 脚本,其中的一部分需要用 ASCII 代码的十六进制值替换某个子集中的字符。我做了一些研究,但找不到任何东西,所以我开始认为 sed 没有让我这样做的功能。如果这里有sed高手,请赐教吗?
P.S.:sed -e "s/A/41/g"-e "s/B/42/g"... 等
之类的解决方案是行不通的。
最佳答案
如果 perl 是您的可行替代方案,那么:
fge@erwin ~ $ perl -pe 's,[abcRte], ord($&) ,ge'
oiiiiisdfa
oiiiiisdf97
abcRte
97989982116101
关于linux - 有没有办法在 sed 中获取字符的 ASCII 码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8623483/
我是一名优秀的程序员,十分优秀!