Re: [NMOSUG-L] generated a list of leading-zero numbers?

"Wesley J. Landaker" <[email protected]> Tue, 23 Feb 2010 09:42:41 -0700
Newsgroups gmane.org.user-groups.nmlug
Organization icecavern.net
Message-ID <[email protected]>
--===============0749269550==
Content-Type: multipart/signed;
  boundary="nextPart2437467.gSoKLgMtVK";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit

--nextPart2437467.gSoKLgMtVK
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

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

--nextPart2437467.gSoKLgMtVK
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAkuEBYEACgkQ8KmKTEzW49J2uACeLi75FaS4uGDfpScY+4g4o2Ou
UUoAn1GF9h/mQ5GM++IEpVTVxZsCZavk
=/w6/
-----END PGP SIGNATURE-----

--nextPart2437467.gSoKLgMtVK--

--===============0749269550==
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

--===============0749269550==--