Re: generated a list of leading-zero numbers?

Pete Zaitcev <[email protected]> Wed, 3 Mar 2010 09:35:52 -0700
Newsgroups gmane.org.user-groups.nmlug
Organization Red Hat, Inc.
Message-ID <[email protected]>
On Tue, 23 Feb 2010 08:48:54 -0700
Jody Harris <[email protected]> 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
_______________________________________________
NMLUG mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug