shell的按位与
![](http://www.cncsto.com/contentimg/4.jpg)
在c程序里对32位实现按位与和移位特别方便,所以设计了一个字段由3个语义组成。
但用脚本处理数据时,shell好像不方便。
#4 100 #3 011 $echo $((4 & 3)) 0 # 5 1001 # 3 011 $echo $((5 & 3)) 1
因为不能得到按位与的准确结果,所以选择移位后,与目标值比较读取yes or no
原文:https://www.cnblogs.com/toughcactus/p/14980472.html
在c程序里对32位实现按位与和移位特别方便,所以设计了一个字段由3个语义组成。
但用脚本处理数据时,shell好像不方便。
#4 100 #3 011 $echo $((4 & 3)) 0 # 5 1001 # 3 011 $echo $((5 & 3)) 1
因为不能得到按位与的准确结果,所以选择移位后,与目标值比较读取yes or no
原文:https://www.cnblogs.com/toughcactus/p/14980472.html