Re: [NMOSUG-L] generated a list of leading-zero numbers?
Jody Harris <[email protected]> Tue, 23 Feb 2010 10:31:22 -0700
| Newsgroups | gmane.org.user-groups.nmlug |
|---|---|
| Message-ID | <[email protected]> |
--===============1454682318== Content-Type: multipart/alternative; boundary=000e0cd4b11a494e6f048047ec7d --000e0cd4b11a494e6f048047ec7d Content-Type: text/plain; charset=ISO-8859-1 printf 'foo%04d\n' `seq 1 45` ---- - 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 10:16 AM, Jody Harris <[email protected]> wrote: > 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 >> > > --000e0cd4b11a494e6f048047ec7d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable printf 'foo%04d\n' `seq 1 45`<div><br clear=3D"all">----<br>- Think= carefully.<br>- Contra mundum - "Against the world" (St. Athanas= ius)<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 10:16 AM, Jody H= arris <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">havoc@ha= rrisdev.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" styl= e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Yeah... that's much better. I was just drawing a blank.<div><br></div><= div>Thanks!</div><div class=3D"im">----<br>- Think carefully.<br>- Contra m= undum - "Against the world" (St. Athanasius)<br> - Credo ut intelligam - "I believe that I may know" (St. Augustin= of Hippo)<br> <br><br></div><div><div></div><div class=3D"h5"><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]" target=3D"_blank">[email protected]</a>= ></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <div>On Tuesday 23 February 2010 08:48:54 Jody Harris wrote:<br> > 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> </div></div></blockquote></div><br></div> --000e0cd4b11a494e6f048047ec7d-- --===============1454682318== 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 --===============1454682318==--