Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


devel / comp.unix.shell / Export multiple environment variables with the dependency relationships at once.

SubjectAuthor
* Export multiple environment variables with the dependencyhongy...@gmail.com
+* Re: Export multiple environment variables with the dependencyBit Twister
|+- Re: Export multiple environment variables with the dependencyhongy...@gmail.com
|`* Re: Export multiple environment variables with the dependency relationships at oKeith Thompson
| +* Re: Export multiple environment variables with the dependencyJanis Papanagnou
| |+* Re: Export multiple environment variables with the dependencyBit Twister
| ||`- Re: Export multiple environment variables with the dependencyJanis Papanagnou
| |`- Re: Export multiple environment variables with the dependencyhongy...@gmail.com
| `- Re: Export multiple environment variables with the dependencyhongy...@gmail.com
`* Re: Export multiple environment variables with the dependencyKaz Kylheku
 `- Re: Export multiple environment variables with the dependencyhongy...@gmail.com

1
Export multiple environment variables with the dependency relationships at once.

<d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5467&group=comp.unix.shell#5467

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a37:917:0:b0:6b5:b9a4:bdda with SMTP id 23-20020a370917000000b006b5b9a4bddamr16579409qkj.36.1659504167235;
Tue, 02 Aug 2022 22:22:47 -0700 (PDT)
X-Received: by 2002:a05:6808:11c4:b0:2f9:ccd6:15a4 with SMTP id
p4-20020a05680811c400b002f9ccd615a4mr1044503oiv.219.1659504166483; Tue, 02
Aug 2022 22:22:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Tue, 2 Aug 2022 22:22:46 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.91.163; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.91.163
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
Subject: Export multiple environment variables with the dependency
relationships at once.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 03 Aug 2022 05:22:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1467
 by: hongy...@gmail.com - Wed, 3 Aug 2022 05:22 UTC

I set the environment variables as follows for my customized script/program/tool as follows:

script_realdirname=/path/to/some/script
export ISODATA=$script_realdirname/iso/
export PATH=$ISODATA:$PATH

If I combine the above last two lines into the following, the PATH export does not seem to take effect:

export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH

Any hints for this problem?

Regards,
Zhao

Re: Export multiple environment variables with the dependency relationships at once.

<slrntek58h.f0b7.BitTwister@wb.home.test>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5470&group=comp.unix.shell#5470

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: BitTwister@mouse-potato.com (Bit Twister)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
Date: Wed, 3 Aug 2022 01:26:22 -0500
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <slrntek58h.f0b7.BitTwister@wb.home.test>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
Injection-Info: reader01.eternal-september.org; posting-host="35cffcb1d5923c9b43901a616bc69d48";
logging-data="2173203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198AOdW4zydZXPANWJD+CtrXYbbLxzfIFg="
User-Agent: slrn/pre1.0.4-6 (Linux)
Cancel-Lock: sha1:RyBWEd9n59Pdcrg9g+tFtAuKzBA=
 by: Bit Twister - Wed, 3 Aug 2022 06:26 UTC

On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
> I set the environment variables as follows for my customized script/program/tool as follows:
>
> script_realdirname=/path/to/some/script
> export ISODATA=$script_realdirname/iso/
> export PATH=$ISODATA:$PATH
>
> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
>
> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>
> Any hints for this problem?

Not me since it appears to work for me.

[bittwister@wb ~]$ script_realdirname=/path/to/some/script
[bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
[bittwister@wb ~]$ export PATH=$ISODATA:$PATH
[bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
[bittwister@wb ~]$ echo $PATH
/path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin

Re: Export multiple environment variables with the dependency relationships at once.

<af305e70-1869-4ea0-af3c-439146880299n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5471&group=comp.unix.shell#5471

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:622a:1646:b0:33c:cecc:96e4 with SMTP id y6-20020a05622a164600b0033ccecc96e4mr2780434qtj.350.1659509831731;
Tue, 02 Aug 2022 23:57:11 -0700 (PDT)
X-Received: by 2002:a05:6830:621b:b0:61c:f67c:556 with SMTP id
cd27-20020a056830621b00b0061cf67c0556mr643144otb.221.1659509831462; Tue, 02
Aug 2022 23:57:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Tue, 2 Aug 2022 23:57:11 -0700 (PDT)
In-Reply-To: <slrntek58h.f0b7.BitTwister@wb.home.test>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.91.163; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.91.163
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com> <slrntek58h.f0b7.BitTwister@wb.home.test>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <af305e70-1869-4ea0-af3c-439146880299n@googlegroups.com>
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 03 Aug 2022 06:57:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: hongy...@gmail.com - Wed, 3 Aug 2022 06:57 UTC

On Wednesday, August 3, 2022 at 2:26:30 PM UTC+8, Bit Twister wrote:
> On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
> > I set the environment variables as follows for my customized script/program/tool as follows:
> >
> > script_realdirname=/path/to/some/script
> > export ISODATA=$script_realdirname/iso/
> > export PATH=$ISODATA:$PATH
> >
> > If I combine the above last two lines into the following, the PATH export does not seem to take effect:
> >
> > export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> >
> > Any hints for this problem?
> Not me since it appears to work for me.
>
> [bittwister@wb ~]$ script_realdirname=/path/to/some/script
> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
> [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> [bittwister@wb ~]$ echo $PATH
> /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin

Thank you for your confirmation. It seems that I messed up a few things at the time, and it actually works as you described.

Best,
Zhao

Re: Export multiple environment variables with the dependency relationships at once.

<87sfmduy2j.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5474&group=comp.unix.shell#5474

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency relationships at once.
Date: Wed, 03 Aug 2022 08:49:24 -0700
Organization: None to speak of
Lines: 39
Message-ID: <87sfmduy2j.fsf@nosuchdomain.example.com>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="2bd58f3e1ff1f0619028f559296b014c";
logging-data="2432775"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19t1Cvp/bbAJ2d852UYxz5A"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:B1gl649g0XivX/I8OcXi0Ua7VWY=
sha1:v091A9NavkdXsTwSdvDhQmAf86c=
 by: Keith Thompson - Wed, 3 Aug 2022 15:49 UTC

Bit Twister <BitTwister@mouse-potato.com> writes:
> On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
>> I set the environment variables as follows for my customized script/program/tool as follows:
>>
>> script_realdirname=/path/to/some/script
>> export ISODATA=$script_realdirname/iso/
>> export PATH=$ISODATA:$PATH
>>
>> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
>>
>> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>>
>> Any hints for this problem?
>
> Not me since it appears to work for me.
>
> [bittwister@wb ~]$ script_realdirname=/path/to/some/script
> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
> [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> [bittwister@wb ~]$ echo $PATH
> /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin

It works for you because you *added* the double export command after
executing the export ISODATA=... and export PATH=... commands.

If you *replace* the two export commands with a single one, then of
course the ISODATA hasn't been set yet, and '$ISODATA' doesn't expand.

$ export ZERO=ONE TWO=$ZERO
bash: ZERO: unbound variable
$

(I have `set -o nounset`.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Export multiple environment variables with the dependency relationships at once.

<tce62h$2ar64$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5475&group=comp.unix.shell#5475

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
Date: Wed, 3 Aug 2022 18:00:06 +0200
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <tce62h$2ar64$1@dont-email.me>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test>
<87sfmduy2j.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 3 Aug 2022 16:00:17 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ea96e48ae4c422da16517e3b48a89493";
logging-data="2452676"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193n8NnGXamPG4hj0ZdaU+u"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:aAcQbxYsTNKXh+9wFdshBqF4774=
In-Reply-To: <87sfmduy2j.fsf@nosuchdomain.example.com>
 by: Janis Papanagnou - Wed, 3 Aug 2022 16:00 UTC

On 03.08.2022 17:49, Keith Thompson wrote:
> Bit Twister <BitTwister@mouse-potato.com> writes:
>> On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
>>> I set the environment variables as follows for my customized script/program/tool as follows:
>>>
>>> script_realdirname=/path/to/some/script
>>> export ISODATA=$script_realdirname/iso/
>>> export PATH=$ISODATA:$PATH
>>>
>>> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
>>>
>>> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>>>
>>> Any hints for this problem?
>>
>> Not me since it appears to work for me.
>>
>> [bittwister@wb ~]$ script_realdirname=/path/to/some/script
>> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
>> [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
>> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>> [bittwister@wb ~]$ echo $PATH
>> /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin
>
> It works for you because you *added* the double export command after
> executing the export ISODATA=... and export PATH=... commands.

It might also work for him because he might be using ksh.
In other words; it works for me.

But chances are high that the OP is using bash.

Janis

>
> If you *replace* the two export commands with a single one, then of
> course the ISODATA hasn't been set yet, and '$ISODATA' doesn't expand.
>
> $ export ZERO=ONE TWO=$ZERO
> bash: ZERO: unbound variable
> $
>
> (I have `set -o nounset`.)
>

Re: Export multiple environment variables with the dependency relationships at once.

<20220803095410.378@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5476&group=comp.unix.shell#5476

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
Date: Wed, 3 Aug 2022 17:03:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20220803095410.378@kylheku.com>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
Injection-Date: Wed, 3 Aug 2022 17:03:28 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e3ef70d1e515b85c870b47e95809ced3";
logging-data="2475839"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KVmIHUIgQ2isHvNmAXw/03ARf9KnBxJk="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:j8zUvqK2Jz+8PohW98YegRuO1vM=
 by: Kaz Kylheku - Wed, 3 Aug 2022 17:03 UTC

On 2022-08-03, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
> I set the environment variables as follows for my customized script/program/tool as follows:
>
> script_realdirname=/path/to/some/script
> export ISODATA=$script_realdirname/iso/
> export PATH=$ISODATA:$PATH
>
> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
>
> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH

export effectively has parallel binding semantics, because the
values being assigned to to the variables are expanded strings,
and the expansion takes place before export executes.

Example: exchange the values of x and y:

$ x=x
$ y=y
$ export x=$y y=$x
$ echo $x
y
$ echo $y
x

The export command first expands to.

export x=y y=x

This expansion no longer contains any variables to be expanded; its
arguments are pure text. But the export command has not yet
executed, so x and y still have their original values.

So when export executes, x is set to "y" and y to "x".
Those new values are no longer being calculated from prior
values. All the use of prior values took place when the
command line was expanded.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Export multiple environment variables with the dependency relationships at once.

<slrntelr3d.10ji.BitTwister@wb.home.test>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5483&group=comp.unix.shell#5483

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: BitTwister@mouse-potato.com (Bit Twister)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
Date: Wed, 3 Aug 2022 16:45:01 -0500
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <slrntelr3d.10ji.BitTwister@wb.home.test>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test>
<87sfmduy2j.fsf@nosuchdomain.example.com> <tce62h$2ar64$1@dont-email.me>
Injection-Info: reader01.eternal-september.org; posting-host="35cffcb1d5923c9b43901a616bc69d48";
logging-data="2621696"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1BonRYlY/dNDiNsv15tbwXUC1ph+q7Ec="
User-Agent: slrn/pre1.0.4-6 (Linux)
Cancel-Lock: sha1:JxtugcOBJXPUhkdEDKbhI+CPJzs=
 by: Bit Twister - Wed, 3 Aug 2022 21:45 UTC

On Wed, 3 Aug 2022 18:00:06 +0200, Janis Papanagnou wrote:
> On 03.08.2022 17:49, Keith Thompson wrote:
>> Bit Twister <BitTwister@mouse-potato.com> writes:
>>> On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
>>>> I set the environment variables as follows for my customized script/program/tool as follows:
>>>>
>>>> script_realdirname=/path/to/some/script
>>>> export ISODATA=$script_realdirname/iso/
>>>> export PATH=$ISODATA:$PATH
>>>>
>>>> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
>>>>
>>>> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>>>>
>>>> Any hints for this problem?
>>>
>>> Not me since it appears to work for me.
>>>
>>> [bittwister@wb ~]$ script_realdirname=/path/to/some/script
>>> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
>>> [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
>>> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
>>> [bittwister@wb ~]$ echo $PATH
>>> /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin
>>
>> It works for you because you *added* the double export command after
>> executing the export ISODATA=... and export PATH=... commands.
>
> It might also work for him because he might be using ksh.

But I am not.

$ echo $SHELL
/bin/bash

$ ls -l /bin/bash
-rwxr-xr-x 1 root root 947520 Dec 30 2020 /bin/bash

> In other words; it works for me.

$ $SHELL --version
GNU bash, version 5.1.4(1)-release (x86_64-mageia-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Re: Export multiple environment variables with the dependency relationships at once.

<tcevim$2hgs8$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5484&group=comp.unix.shell#5484

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
Date: Thu, 4 Aug 2022 01:15:34 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <tcevim$2hgs8$1@dont-email.me>
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test>
<87sfmduy2j.fsf@nosuchdomain.example.com> <tce62h$2ar64$1@dont-email.me>
<slrntelr3d.10ji.BitTwister@wb.home.test>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 3 Aug 2022 23:15:34 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9055784fb31db19f7f88fc4f49fcc020";
logging-data="2671496"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ThXTLpcEpK2aeXjSu7MHX"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:ytEW2TEFm0wiBPaBA+0OmXfcinA=
In-Reply-To: <slrntelr3d.10ji.BitTwister@wb.home.test>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Wed, 3 Aug 2022 23:15 UTC

On 03.08.2022 23:45, Bit Twister wrote:
> On Wed, 3 Aug 2022 18:00:06 +0200, Janis Papanagnou wrote:
>> On 03.08.2022 17:49, Keith Thompson wrote:
>>>
>>> It works for you because [...]
>>
>> It might also work for him because he might be using ksh.
>
> But I am not.

The emphasis was not on "you" (personally) but on the fact that
the shell was unspecified and other shells behave differently.

As Keith already pointed out, with the code "you" (personally)
tried you wouldn't observe the problem in the first place.

Janis

Re: Export multiple environment variables with the dependency relationships at once.

<0f994776-3eb6-43f3-91ca-f55d692e1571n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5485&group=comp.unix.shell#5485

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:2889:b0:6b6:5410:b2c7 with SMTP id j9-20020a05620a288900b006b65410b2c7mr20380554qkp.697.1659575361187;
Wed, 03 Aug 2022 18:09:21 -0700 (PDT)
X-Received: by 2002:aca:1b13:0:b0:322:4c21:6ba3 with SMTP id
b19-20020aca1b13000000b003224c216ba3mr2857481oib.204.1659575359468; Wed, 03
Aug 2022 18:09:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 3 Aug 2022 18:09:19 -0700 (PDT)
In-Reply-To: <87sfmduy2j.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.91.163; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.91.163
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test> <87sfmduy2j.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0f994776-3eb6-43f3-91ca-f55d692e1571n@googlegroups.com>
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 04 Aug 2022 01:09:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3449
 by: hongy...@gmail.com - Thu, 4 Aug 2022 01:09 UTC

On Wednesday, August 3, 2022 at 11:49:42 PM UTC+8, Keith Thompson wrote:
> Bit Twister <BitTw...@mouse-potato.com> writes:
> > On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
> >> I set the environment variables as follows for my customized script/program/tool as follows:
> >>
> >> script_realdirname=/path/to/some/script
> >> export ISODATA=$script_realdirname/iso/
> >> export PATH=$ISODATA:$PATH
> >>
> >> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
> >>
> >> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> >>
> >> Any hints for this problem?
> >
> > Not me since it appears to work for me.
> >
> > [bittwister@wb ~]$ script_realdirname=/path/to/some/script
> > [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
> > [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
> > [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> > [bittwister@wb ~]$ echo $PATH
> > /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin
> It works for you because you *added* the double export command after
> executing the export ISODATA=... and export PATH=... commands.
>
> If you *replace* the two export commands with a single one, then of
> course the ISODATA hasn't been set yet, and '$ISODATA' doesn't expand.
>
> $ export ZERO=ONE TWO=$ZERO
> bash: ZERO: unbound variable
> $

Here's my test:

werner@X10DAi-00:~$ export ZERO=ONE TWO=$ZERO
werner@X10DAi-00:~$ echo $TWO

werner@X10DAi-00:~$ echo $ZERO
ONE


> (I have `set -o nounset`.)
>
> --
> Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
> Working, but not speaking, for Philips
> void Void(void) { Void(); } /* The recursive call of the void */

Re: Export multiple environment variables with the dependency relationships at once.

<04f55652-0896-41a3-b780-1706c6bdfc95n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5486&group=comp.unix.shell#5486

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a0c:fe69:0:b0:473:9d82:b160 with SMTP id b9-20020a0cfe69000000b004739d82b160mr24562637qvv.111.1659575881012;
Wed, 03 Aug 2022 18:18:01 -0700 (PDT)
X-Received: by 2002:a05:6808:190f:b0:340:b7e:743f with SMTP id
bf15-20020a056808190f00b003400b7e743fmr2755303oib.221.1659575880764; Wed, 03
Aug 2022 18:18:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 3 Aug 2022 18:18:00 -0700 (PDT)
In-Reply-To: <20220803095410.378@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.91.163; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.91.163
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com> <20220803095410.378@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <04f55652-0896-41a3-b780-1706c6bdfc95n@googlegroups.com>
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 04 Aug 2022 01:18:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 44
 by: hongy...@gmail.com - Thu, 4 Aug 2022 01:18 UTC

On Thursday, August 4, 2022 at 1:03:33 AM UTC+8, Kaz Kylheku wrote:
> On 2022-08-03, hongy...@gmail.com <hongy...@gmail.com> wrote:
> > I set the environment variables as follows for my customized script/program/tool as follows:
> >
> > script_realdirname=/path/to/some/script
> > export ISODATA=$script_realdirname/iso/
> > export PATH=$ISODATA:$PATH
> >
> > If I combine the above last two lines into the following, the PATH export does not seem to take effect:
> >
> > export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> export effectively has parallel binding semantics, because the
> values being assigned to to the variables are expanded strings,
> and the expansion takes place before export executes.
>
> Example: exchange the values of x and y:
>
> $ x=x
> $ y=y
> $ export x=$y y=$x
> $ echo $x
> y
> $ echo $y
> x
>
> The export command first expands to.
>
> export x=y y=x
>
> This expansion no longer contains any variables to be expanded; its
> arguments are pure text. But the export command has not yet
> executed, so x and y still have their original values.
>
> So when export executes, x is set to "y" and y to "x".
> Those new values are no longer being calculated from prior
> values. All the use of prior values took place when the
> command line was expanded.

Thank you for your wonderful analysis and example.

Zhao
> --
> TXR Programming Language: http://nongnu.org/txr
> Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Export multiple environment variables with the dependency relationships at once.

<f70e6701-0461-4910-b598-4762647da166n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=5487&group=comp.unix.shell#5487

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:59c6:0:b0:33f:9b04:322d with SMTP id f6-20020ac859c6000000b0033f9b04322dmr3280376qtf.55.1659575927789;
Wed, 03 Aug 2022 18:18:47 -0700 (PDT)
X-Received: by 2002:aca:ab0a:0:b0:33e:974c:440a with SMTP id
u10-20020acaab0a000000b0033e974c440amr2790706oie.40.1659575927534; Wed, 03
Aug 2022 18:18:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 3 Aug 2022 18:18:47 -0700 (PDT)
In-Reply-To: <tce62h$2ar64$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.91.163; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.91.163
References: <d38bda5e-3222-42b4-acb7-e42a9b2a3da9n@googlegroups.com>
<slrntek58h.f0b7.BitTwister@wb.home.test> <87sfmduy2j.fsf@nosuchdomain.example.com>
<tce62h$2ar64$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f70e6701-0461-4910-b598-4762647da166n@googlegroups.com>
Subject: Re: Export multiple environment variables with the dependency
relationships at once.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 04 Aug 2022 01:18:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 54
 by: hongy...@gmail.com - Thu, 4 Aug 2022 01:18 UTC

On Thursday, August 4, 2022 at 12:00:24 AM UTC+8, Janis Papanagnou wrote:
> On 03.08.2022 17:49, Keith Thompson wrote:
> > Bit Twister <BitTw...@mouse-potato.com> writes:
> >> On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:
> >>> I set the environment variables as follows for my customized script/program/tool as follows:
> >>>
> >>> script_realdirname=/path/to/some/script
> >>> export ISODATA=$script_realdirname/iso/
> >>> export PATH=$ISODATA:$PATH
> >>>
> >>> If I combine the above last two lines into the following, the PATH export does not seem to take effect:
> >>>
> >>> export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> >>>
> >>> Any hints for this problem?
> >>
> >> Not me since it appears to work for me.
> >>
> >> [bittwister@wb ~]$ script_realdirname=/path/to/some/script
> >> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/
> >> [bittwister@wb ~]$ export PATH=$ISODATA:$PATH
> >> [bittwister@wb ~]$ export ISODATA=$script_realdirname/iso/ PATH=$ISODATA:$PATH
> >> [bittwister@wb ~]$ echo $PATH
> >> /path/to/some/script/iso/:/path/to/some/script/iso/:/home/bittwister/local/work:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/local/bin:/usr/local/games:/usr/games:/home/bittwister/local/bin:/local/bin
> >
> > It works for you because you *added* the double export command after
> > executing the export ISODATA=... and export PATH=... commands.
> It might also work for him because he might be using ksh.
> In other words; it works for me.
>
> But chances are high that the OP is using bash.

Yes. Exactly.

Zhao

>
> Janis
> >
> > If you *replace* the two export commands with a single one, then of
> > course the ISODATA hasn't been set yet, and '$ISODATA' doesn't expand.
> >
> > $ export ZERO=ONE TWO=$ZERO
> > bash: ZERO: unbound variable
> > $
> >
> > (I have `set -o nounset`.)
> >

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor