Classification: UNCLASSIFIED Caveats: NONE "...a leading zero is the well-understood way to denote an octal value on Unix and Linux systems." - is this something new since RHEL 4.7 using tcsh or csh? Steve -----Original Message----- From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Jonathan S Billings Sent: Monday, January 03, 2011 10:56 AM To: redhat-list@xxxxxxxxxx Subject: Re: Strange assignment - new version (UNCLASSIFIED) On 01/03/2011 11:27 AM, Glasgow, Steven Mr CIV USA TRADOC wrote: > RHEL 5.4: > > > @ D=44 ; echo $D returns 44 > @ D=044 ; echo $D returns 36 --- HUH? > @ D=08 ; echo $D returns @: Badly formed number --- HUH? > > > Seems to be an octal thing going on. Would anyone be able to shed > some light on this and how I might get 5.4 to act more like 4.7? To be honest, I wasn't able to reproduce this behavior on my RHEL5.5 system with the bash-3.2-24.el5.x86_64 package: % D=08; echo $D 08 However, I remember having problems with using 'date "+%H"' and then using the -gt greater-than comparisons, because date zero-spaced the hour and 8AM was "08". I ended up fixing it by using %k instead of %H. Bash now interprets numbers starting with a 0 as octal. This is common in other languages as well. You could force the encoding by using 10#08 I believe, however I don't believe there is a way to disable this behavior, since a leading zero is the well-understood way to denote an octal value on Unix and Linux systems. -- Jonathan Billings <jsbillin@xxxxxxxxx> College of Engineering - CAEN - Unix and Linux Support -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list Classification: UNCLASSIFIED Caveats: NONE -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list