[lug] Remember Y2K?
Jeffrey S. Haemer
jeffrey.haemer at gmail.com
Mon Feb 24 16:06:08 MST 2014
I just fixed a W08 problem. This morning, a shell script I'd written
started to fail. The problem was a line adding the week-of-year to
x=$(( $(date +%W) + something_else ))
What could possibly be wrong with that?
Answer: $(date +%W) returns (starting this week) 08 . Bash says "The
leading zero says you mean 'octal.' Shame on you. Eight is *not* an octal
That sound you heard around 3:15 this afternoon was me, smacking my
My solution was to change it to 10#$(date +%W)
Is there a better solution?
Jeffrey Haemer <jeffrey.haemer at gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
*פרייהייט? דאס איז יאַנג דינען וואָרט.*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LUG