SliTaz SliTaz Forum

You are not logged in.

#1 2013-05-26 17:59:49

llev
Member
Registered: 2011-12-09
Posts: 568

Patch to /etc/profile

Hi,

Under Slitaz 4, I just edited /etc/profile so that it exports all variables sourced from locale.conf:

line 38 is changed from

        export LANG LC_ALL

to

        export LANG ${!LC_@}

This allows fine-tuning of locale, such as

LC_CTYPE=fr_FR.UTF-8

LC_NUMERIC=C

LC_COLLATE=C

for example.

I hope you'll find this patch worth applying.

Offline

#2 2013-05-27 09:49:43

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Patch to /etc/profile

Sorry, no.

${!LC_@} not works in my default shell.

[c]/bin/sh: syntax error: bad substitution[/c]
Do I need Bash? Really, no. And our default SliTaz ISO have no Bash too.

Maybe you know other way to do the same? Good as idea.

Offline

#3 2013-05-27 18:58:25

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Patch to /etc/profile

Sorry, I thought bash behaved like sh when invoked as sh. (Or maybe the default Slitaz sh isn't fully sh compliant? Whatever.)

Another way is:

export LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES

export LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL

Tedious but should work wink

Offline

#4 2013-05-28 07:41:47

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Patch to /etc/profile

(Or maybe the default Slitaz sh isn't fully sh compliant? Whatever.)

Interesting document about our shell: man ash.

Tedious but should work wink

Let's test, what will be if I not set some LC_* variable, and don't want to see it.

Test.

1. Variable NONSET not exist:

[c]export NONSET
env | grep NONSET[/c]
(empty)

2. Existing variable ISSET:

[c]ISSET=isset
export ISSET
env | grep ISSET
ISSET=isset[/c]
OK, it worked as expected. Only LC_* variables that sourced from /etc/locale.conf will be exported.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]