home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] generated a list of leading-zero numbers?



On Tue, 23 Feb 2010 08:48:54 -0700
Jody Harris <havoc at harrisdev.com> wrote:

> I sometimes need to generate a list of numbers with leading zeros. What's
> the easiest way to do this at the shell?
> 
> I put this together, but it just seems too indirect:
> for id in `for ((i=0; i<45; i++)); do echo; done | nl -ba -nrz`; do echo
> foo$id; done

How about:
seq -w 0 44

-- Pete




Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache