unix programming -- Industry guru Dave Taylor answers questions about a wide variety of technical topics, including HTML, online advertising, Cascading Style Sheets, Web design, Unix, Linux, search engine optimization, Mac OS X, shell script programming and Microsoft Windows.

"unix programming" Help and Information



How do I strip leading zeroes for math in a shell script?

I have a file containing lines of data that are amounts padded with leading zeros, similar to the snip below.   0000000004   0000000016   0000000012   0000000008 Using a shell script, how can I add up a column of numbers contained in lines when BASH interprets the numbers as octal when I do in-line math?...

Continue reading about How do I strip leading zeroes for math in a shell script?


Advanced Search :: Ask Dave Taylor!


Match case   Search using regular expressions
Search: Entries Comments Both
Sort By:
Sort Order:
Search entries from:
Maximum results shown:


Need Help? Ask Dave Taylor!
Search