bash script issue

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Thu Sep 4 23:45:16 UTC 2014


On Wed, Sep 03, 2014 at 08:07:55PM -0400, Chris F.A. Johnson wrote

> $ q=0056789
> $ echo "$((10#$q+1))"
> 56790
> 
>    Or, if you want leading zeroes in the output:
> 
> printf '%08d\n' "$((10#$q+1))"

  Thanks.  It's stuff like this that makes this mailing list worthwhile.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
I don't run "desktop environments"; I run useful applications
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list