Re: repeating a character a variable number of times
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Sat, 28 Aug 2010 20:20:28 +0000 (UTC)
On 2010-08-21, Wayne wrote:
....
The '%*d' of printf is not portable, or at least not part of
the POSIX standard.
Look again. It *is* in the standard.
You need to use eval for this in shell:
eval printf "%0${count}d" 0
eval is not necessary (try it and see).
--
Chris F.A. Johnson, author <http://shell.cfajohnson.com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
.
- Follow-Ups:
- Re: repeating a character a variable number of times
- From: Gennaro Prota
- Re: repeating a character a variable number of times
- References:
- repeating a character a variable number of times
- From: mbs400
- Re: repeating a character a variable number of times
- From: John Kelly
- Re: repeating a character a variable number of times
- From: Gennaro Prota
- Re: repeating a character a variable number of times
- From: Wayne
- repeating a character a variable number of times
- Prev by Date: Re: repeating a character a variable number of times
- Next by Date: Re: sed - what do these lines do ?
- Previous by thread: Re: repeating a character a variable number of times
- Next by thread: Re: repeating a character a variable number of times
- Index(es):
Relevant Pages
|