Description of problem: The man page for tcsh says that strings which begin with '0' are considered octal numbers, but they aren't actually treated as such by tcsh. From tcsh(1): "Strings which begin with ‘0’ are considered octal numbers. Null or missing arguments are considered ‘0’. The results of all expressions are strings, which represent decimal numbers. It is important to note that no two components of an expression can appear in the same word; except when adjacent to components of expressions which are syntactically significant to the parser (‘&’ ‘|’ ‘<’ ‘>’ ‘(’ ‘)’) they should be surrounded by spaces." Version-Release number of selected component (if applicable): tcsh-6.14-12.el5 Red Hat Enterprise Linux Server release 5.1 (Tikanga) How reproducible: 100% Steps to Reproduce: 1. $ cat > test.sh << EOF #! /bin/tcsh # test 1 @ i = -020 echo $i # test 2 if (010 * 2 == 16) then echo "16" endif # test 3 ( exit 010 ) echo $? EOF 2. $ ./test.sh Actual results: $ ./test.sh -20 10 Expected results: $ ./test.sh -16 16 8 Additional info: Upstream bug: http://bugs.gw.com/view.php?id=54 Backported patch for RHEL 5 is attached.
Created attachment 298477 [details] patch backported from tcsh 6.15.01
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-0060.html