执行shell语句: echo $((08-1)) 没有打印7,却显示错误:value too great for base,原因由于进制运算出错。对0x来说,shell会解析成8进制,8明显超出了8进制范围,因此报错。那进制间如何转换呢,可通过下列方式:
1.awk
echo "10" | awk '{printf "0x%x\n",$0}' 将10转换成16进制,显示0xa。格式说明符与C语言printf()一致
2.BASE#NUMBER
let a=10#08 第一次看到这种表达式,还以为a=10呢。注释#与表达式间是有空格分隔的,该表达式表明将08以10进制处理
3.bc命令
man 'obase=16;08' | bc bc是交互性命令行计算器,支持四则运算。
相关推荐
主要介绍了Shell中的for循环总结,本文讲解了shell中for循环用法、shell下for循环的几种方法等内容,需要的朋友可以参考下
c#shell for android
adb shellfor windows adb shellfor windows
Shell Programming for System Administrators(Solaris).rar
Shell+ Components 3.0 for D6 帮助文件
Linux运维-3.Shell编程-12 shell编程-146for循环之批量添加用户.avi
这是一个基于.NET编写的window shell,在Drag and Drop的时候能够已图片显示拖动的轨迹。
Linux运维-3.Shell编程-12 shell编程-143for循环之语法.avi
sshshell for mac 方便远程管理服务器工具,强烈推荐,爱好命令者使用
AUTO REBOOT FOR UEFI SHELL APPLICATION
Wicked Cool Shell Scripts: 101 Scripts for Linux, Mac OS X, and Unix Systems <br>This cookbook of useful, customizable, and fun scripts gives you the tools to solve common Linux, Mac OS X and UNIX ...
Linux运维-3.Shell编程-12 shell编程-147for循环之批量删除用户.avi
B shell与 C shell的区别 ; B shell的详解和C shell 的详解
Linux运维-运维系统服务04-Shell脚本d4-Shell循环-08for批量创建用户.mp4
shell shell练习 shell入门 shell shell练习 shell入门
sshshell ssh shell 服务器 远程连接 FTP for mac ssh shell 服务器 远程连接
主要介绍了Shell脚本中使用for循环和cat命令实现按顺序合并文件,本文先是用sed命令来实现,发现不能完成需求,后使用for循环解决,需要的朋友可以参考下
base16-shell - Base16 for Shells
shell-base64如何使用: $ printf 'Man' | ./encode_base64.shTWFu$ printf 'TWFu' | ./decode_base64.shMan$ printf 'Man is distinguished, not only by his reason, but by this singular passion from other ...
目录 1Linux下Shell编程入门及变量...7Shell编程FOR循环实战.mp4 8Shell编程FOR循环实战.mp4 9Shell脚本for循环案例演示.mp4 10Shell脚本for循环案例演示.mp4 11Shell实战批量管理主机.mp4 12Shell实战批量管理主机.mp4