Need assistance in getting a solution for a TCSH shell environment variable .
I read on internet that leading zeros as octal numbers and redhat doesnt supports octals but Solaris works on TCSH shell. Is there any way we can fix this . All my script has 08 or 09
Scott . I have some old legacy scripts which are running on Solaris so I am migrating it to linux environment . It will be hard to change some 100 scripts to bash . So I need to fix this . I would appreciate if you know which version of TCSH will work on linux
It's the only version of Solaris I have, but it does have the same version of TCSH (6.17.00) as my RHEL and both give the error. So perhaps it's a "problem" with this version of TSCH (as opposed to 6.12.00 you have on Solaris), or a problem with TCSH on this version (11) of Solaris.
edit: Ah, it seems yesterday, I may have been using CSH, not TCSH. CSH doesn't give the error on Solaris 11, but it still doesn't return an Octal number
Posix, in their wisdom mandated that shells should follow this rule... "Only the decimal-constant, octal-constant, and hexadecimal-constant constants specified in the ISO C standard, Section 6.4.4.1 are required to be recognized as constants". For some reason, shells that are totally non-posix in nature like csh and tcsh are adopting this rule. It has broken a lot of scripts including several hundred of my own. I fixed them all rather than fighting it. But I use ksh which can easily strip off the leading zero. There is no great solution to offer someone who has a lot of csh scripts.
There is no easy way to say this, but if you insist on creating lots of csh scripts you better prepare yourself to face problems with no good solutions. The right answer is to write your scripts in bash or ksh. I know you don't want to hear that, but it's the truth.