[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: {# - strange behavior
From: |
Dal Riata |
Subject: |
Re: {# - strange behavior |
Date: |
Sun, 22 Feb 2009 11:21:34 +0000 |
On Sat, 2009-02-21 at 17:37 -0500, Chet Ramey wrote:
> Antonio Macchi wrote:
> >
> > thanks... but parameters expansions and printf builtin works differently
> > about it...
> >
> >
> >
> >
> > $ locale | grep LC_CTYPE
> > LC_CTYPE="en_US.UTF-8"
> >
> > $ a=eèèèe
> >
> > $ b=eeeee
> >
> > $ echo ${#a}
> > 5
> >
> > $ echo ${#b}
> > 5
> >
> > $ printf "*%-10s*" $a
> > *eèèèe *
> >
> > $ printf "*%-10s*" $b
> > *eeeee *
> >
> >
> >
> >
> > is it ok?
>
> Yes, it's ok. Posix says that printf field widths are specified in number
> of bytes.
>
> Chet
>
... although POSIX isn't always the last word. Development!
Improvement! Is POSIX the way things ought to be in this instance? If
not, what backwards compatible ways of changing the situation are there?
Slightly off topic I know but the radical inside me doesn't let these
things lie!
Regards, Max.
Message not available