"08 :value too great for base" 的原因及解决办法
来源:互联网 发布:nc软件是什么 编辑:程序博客网 时间:2024/06/04 19:20
今天调试shell时候 突然出现一个问题,之前都没有发现过
08 :value too great for base
<pre name="code" class="plain" style="margin: 4px 0px; background-color: rgb(240, 240, 240);">if [ $(($(date "+%M")%5)) -eq $((0)) ];thenecho 111fi
最后跟踪问题,发现在时间为 08分钟和 09分钟时,都会出现这种问题,查阅资料
Numbers starting with leading 0 are Octal numbers (base 8) in many programminglanguages including C, Perl and shell. Valid octal digits are 0,1,2,3,4,5,6,7 so it barfs if it sees an 8 or a 9. You probably wantto work in straight numbers and make a leading 0 in your outputformat with a sprintf("%02d") kind of formatting thing.Anything starting with 0x or 0X is a hex number.So the error message means exactly as it says- it's an error fromthe let function complaining about the value being too big for the base.Have fun,Stuart.
原帖地址:http://www.google.com/search?client=safari&rls=zh-cn&q=value+too+great+for+base&ie=UTF-8&oe=UTF-8
解决方案,增加 10# 定义为十进制就ok了
<pre name="code" class="plain" style="margin: 4px 0px; background-color: rgb(240, 240, 240);">if [ $((10#$(date "+%M")%5)) -eq $((0)) ];thenecho 111fi
0 0
- "08 :value too great for base" 的原因及解决办法
- Shell:value too great for base
- Linux Shell 进制错误 - value too great for base
- Linux Shell 进制错误 - value too great for base
- -bash: 08: value too great for base (error token is "08")
- bash: 09: value too great for base (error token is 09)
- SHELL脚本报错:value too great for base (error token is "00000001830")
- Result Maps collection already contains value for cn.itcast.ssm.mapper.Items的原因及解决办法
- Result Maps collection already contains value for com.liuyanzhao.ssm.mapper.Items的原因及解决办法
- VMware共享文件夹编译出现“Value too large for defined data type”错误的解决办法
- 共享文件夹内编译报”Value too large for defined data type”错误的解决办法
- Result Maps collection already contains value for...BaseResultMap原因及解决办法
- [ERROR] session ip change too many (WebSessionStat.java:266)的原因及不完整解决办法
- GCC编译“Value too large for defined data type”错误解决办法
- mount目录访问出现“Value too large for defined data type”错误解决办法
- GCC编译“Value too large for defined data type”错误解决办法
- Too many open files 产生的原因分析及解决
- ORA-12899: value too large for column
- Spark实战演练:WordCount实例
- [nginx]搭建
- 一个完整的Oracle建表的例子
- python截取二进制文件
- project设置工期为1个工作日,但开始时间与结束时间不是同一天,如何解决或者是设置?
- "08 :value too great for base" 的原因及解决办法
- Java反射
- Android APK的反编译和重新打包
- PHP后台守护进程的实现方式(Linux环境)
- Spring中数据源和数据库连接池配置的几种方法
- CodeForces 366A Dima and Guards
- 第十一讲 $resource 数据交互插件
- 系统的平均并发用户数和并发数峰值如何估算
- 佛珠详情页