Make bootscripts more POSIX compliant

Dan Nicholson dbn.lists at gmail.com
Mon Feb 19 23:56:23 PST 2007


On 2/19/07, Alexander E. Patrakov <patrakov at ums.usu.ru> wrote:
>
> Could you please install posh from
> http://ftp.debian.org/debian/pool/main/p/posh/posh_0.5.4.tar.gz and test
> whether it reveals any additional breakage?

I'll take a look at it. Any background on posh?

> > Second patch is just a tweak for boot_mesg. There's an excessive
> > pipeline using sed and grep to count the characters in the input
> > string. Fortunately, POSIX mandates that shells respect ${#var} to
> > return the length of the string. I chose to add 1 for an extra space
> > (the old way ended up with 2 spaces for some reason). $((...)) can be
> > used for arithmetic expansion according to POSIX.
>
> The reason for this sed was that I planned to include translation of boot
> messages and cope with broken shells like ash that don't count characters in
> UTF-8 locales properly (i.e., the reality is that ${#var} is a bashism, even
> though it is mandated by POSIX).

I see.

> However, since two earlier attempts produced working boot scripts that
> caused absolutely no interest in the LFS community, I revoke the plan, and
> propose to use ${#var}, because it works correctly for English messages (and
> our bootscripts will not produce anything else).

How would an implementation of translated messages work in general? gettext?

--
Dan



More information about the lfs-dev mailing list