您的位置:首页 > 运维架构 > Shell

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

2010-11-08 17:00 501 查看
同样程序代码:

    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进制数值转换)

 

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

(待考)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  command shell login url c