Displaying octal numbers in bash

Joel Hammer Joel
Mon May 17 11:54:03 PDT 2004


I understand that bash will do arithmetic in octal if you prefix the
constant with 0. So:
a=05
b=017
c=$((a*b))
echo $c
yields
75
This is the correct answer, but it is in decimals, not octals.
Is there a way to make echo display octal?
Thanks, 
Joel



More information about the Linux-users mailing list