Michael Tokarev <mjt@tls.msk.ru> writes:
> 19.05.2022 15:59, Philip Hands wrote:
> ...
>> Actually, I'm unable to resist the urge to remove the redundant use of
>> cat (that was already there), so how about doing it in a single sed:
>>
>> LEVEL=$(sed "/^${LOCALE%%_*}/"'{ print $4 ; exit }' /usr/share/localechooser/languagelist)
>
> That smells like awk usage, not sed ;)
Doh!
I started out with awk, as it's cleaner for this, and then noticed that
we don't have awk enabled in d-i's busybox, so changed to sed.
I seem to have messed up what I put in the email ... that's not what's
in the commit:
https://salsa.debian.org/philh/localechooser/-/commit/24206bbaccb9619302bab5ca603fb214841ebf58#63952ea2967253e426478ffea08ddc67c3bff9d8_98_92
sed -ne "/^${LOCALE%%_*}/"'{ s/^[[:alpha:]]*;\([[:digit:]]\);.*/\1/p; q}' /usr/share/localechooser/languagelist
Cheers, Phil.
--
|)| Philip Hands [+44 (0)20 8530 9560] HANDS.COM Ltd.
|-| http://www.hands.com/ http://ftp.uk.debian.org/
|(| Hugo-Klemm-Strasse 34, 21075 Hamburg, GERMANY
Attachment:
signature.asc
Description: PGP signature