在OS X中找不到strtonum [英] strtonum in OS X, not found
本文介绍了在OS X中找不到strtonum的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
cmp -l "$1" "$2/$1" | awk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}'
我正在使用上面的命令从shell脚本显示Ubuntu中的二进制差异.但是,这在OS X lion中不起作用,声称找不到strtonum.知道如何在OS X中使用它或将其替换为类似/轻巧的东西吗?
I am using command above to show the binary differences in Ubuntu, from shell script. However, this doesn't work in OS X lion, claiming that strtonum not found. Any idea how to have it in OS X or substitute it with something similar/light?
推荐答案
MacPorts 或 Homebrew 可用于安装awk
的GNU版本,其中包括strtonum
.为了避免与系统awk
发生冲突,他们将GNU版本安装为gawk
.
Either MacPorts or Homebrew can be used to install the GNU version of awk
which includes strtonum
. To avoid conflicts with the system awk
, they install the GNU version as gawk
.
例如,安装了基本的MacPorts
文件:
For example, with the base MacPorts
files installed:
sudo port install gawk
这篇关于在OS X中找不到strtonum的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文