That's what I thought, but other non-octal combinations work. IE
[EMAIL PROTECTED] paul]$ declare -i dirx=88 ; echo $dirx 88 [EMAIL PROTECTED] paul]$ -- Paul @ Thy Service > I believe it is interpreting the '08' as an octal string, and '8' does not > exist in octal (only 0..7). > > Warren > > On 2/21/06, Paul G. Szabady <[EMAIL PROTECTED]> wrote: >> >> Greetings, >> >> I'm trying to write a script and find something confusing. If you look >> at >> the examples below, I was using #2. It works if I manually set it to >> '8', >> but not '08'. It works with both '6' and '06'. >> >> So, what's special about '08'? >> >> #1 >> [EMAIL PROTECTED] paul]$ declare -i dirx=$(date +%g) >> [EMAIL PROTECTED] paul]$ echo $dirx >> 6 >> >> >> #2 >> [EMAIL PROTECTED] paul]$ declare -i dirx=$(date +%V) >> -bash: declare: 08: value too great for base (error token is "08") >> [EMAIL PROTECTED] paul]$ echo $dirx >> 6 >> >> >> #3 >> [EMAIL PROTECTED] paul]$ declare -i dirx=08 >> -bash: declare: 08: value too great for base (error token is "08") >> [EMAIL PROTECTED] paul]$ echo $dirx >> 6 >> >> >> #4 >> [EMAIL PROTECTED] paul]$ declare -i dirx=8 >> [EMAIL PROTECTED] paul]$ echo $dirx >> 8 >> >> >> #5 >> [EMAIL PROTECTED] paul]$ declare -i dirx=06 >> [EMAIL PROTECTED] paul]$ echo $dirx >> 6 >> >> >> >> [EMAIL PROTECTED] paul]$ export thisweek=(date +%g) ; echo $thisweek >> (date +%g) >> [EMAIL PROTECTED] paul]$ export thisweek=$(date +%g) ; echo $thisweek >> 06 >> [EMAIL PROTECTED] paul]$ export thisweek=$(date +%V) ; echo $thisweek >> 08 >> [EMAIL PROTECTED] paul]$ >> >> >> >> -- >> Paul >> @ Thy Service >> >> >> -- >> TriLUG mailing list : >> http://www.trilug.org/mailman/listinfo/trilug >> TriLUG Organizational FAQ : http://trilug.org/faq/ >> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ >> > > > > -- > http://warrenmyers.com > "God may not play dice with the universe, but something strange is going > on > with the prime numbers." --Paul Erdõs > "It's not possible. We are the type of people who have everything in our > favor going against us." --Ben Jarhvi, Short Circuit 2 > -- > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug > TriLUG Organizational FAQ : http://trilug.org/faq/ > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ -- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
