Re: [NMOSUG-L] generated a list of leading-zero numbers?
Jody Harris <[email protected]> Tue, 23 Feb 2010 10:16:03 -0700
| Newsgroups | gmane.org.user-groups.nmlug |
|---|---|
| Message-ID | <[email protected]> |
--===============1424635692== Content-Type: multipart/alternative; boundary=000e0cd5743882b338048047b515 --000e0cd5743882b338048047b515 Content-Type: text/plain; charset=ISO-8859-1 Yeah... that's much better. I was just drawing a blank. Thanks! ---- - Think carefully. - Contra mundum - "Against the world" (St. Athanasius) - Credo ut intelligam - "I believe that I may know" (St. Augustin of Hippo) On Tue, Feb 23, 2010 at 9:42 AM, Wesley J. Landaker <[email protected]>wrote: > On Tuesday 23 February 2010 08:48:54 Jody Harris wrote: > > I sometimes need to generate a list of numbers with leading zeros. What's > > the easiest way to do this at the shell? > > How about: > > for id in $(seq 1 45); do printf "foo%05d\n" $id; done > --000e0cd5743882b338048047b515 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-8">Ye= ah... that's much better. I was just drawing a blank.<div><br></div><di= v>Thanks!</div>----<br>- Think carefully.<br>- Contra mundum - "Agains= t the world" (St. Athanasius)<br> - Credo ut intelligam - "I believe that I may know" (St. Augustin= of Hippo)<br> <br><br><div class=3D"gmail_quote">On Tue, Feb 23, 2010 at 9:42 AM, Wesley = J. Landaker <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">wjl@= icecavern.net</a>></span> wrote:<br><blockquote class=3D"gmail_quote" st= yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <div class=3D"im">On Tuesday 23 February 2010 08:48:54 Jody Harris wrote:<b= r> > I sometimes need to generate a list of numbers with leading zeros. Wha= t's<br> > the easiest way to do this at the shell?<br> <br> </div>How about:<br> <br> for id in $(seq 1 45); do printf "foo%05d\n" $id; done<br> </blockquote></div><br> --000e0cd5743882b338048047b515-- --===============1424635692== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ NMLUG mailing list [email protected] http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug --===============1424635692==--