tcsh版本问题(字符串转化为数值)

同样程序代码:

    set a = '010'
    @ b = $a
    echo $a
    echo $b

正常机器运行结果:

010

10

异常机器结果:

010

8

正常运行机器的tcsh版本:

tcsh 6.13.00 (Astron) 2004-05-19 (i386-intel-linux) options 8b,nls,dl,al,kan,rh,color,dspm,filec

 

异常运行机器tcsh版本:

tcsh --version:

tcsh 6.14.00 (Astron) 2005-03-25 (i386-intel-linux) options wide,nls,dl,al,kan,sm,rh,color,filec

 

yum info tcsh:
Installed Packages
Name       : tcsh
Arch       : i386
Version    : 6.14
Release    : 14.el5
Size       : 1.1 M
Repo       : installed
Summary    : C シェル csh の強化版
URL        : http://www.tcsh.org/
License    : distributable
Description: Tcsh is an enhanced but completely compatible version of csh, the C
           : shell.  Tcsh is a command language interpreter which can be used
           : both as an interactive login shell and as a shell script command
           : processor. Tcsh includes a command line editor, programmable word
           : completion, spelling correction, a history mechanism, job control
           : and a C language like syntax.

-------------------------------

 

估计是options wide与options 8b的问题

tcsh 6.14支持了8进制?(上面程序中tcsh 6.14把$a当成了8进制数值转换)

 

看来在不改变代码的前提下只能换个版本了。

(待考)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值