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?
On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:bin
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/
Bit Twister <BitTwister@mouse-potato.com> writes:bin
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/
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`.)
On Tue, 2 Aug 2022 22:22:46 -0700 (PDT), hongy...@gmail.com wrote:bin
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/
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
On 03.08.2022 17:49, Keith Thompson wrote:local/bin
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:/
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.
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.
Bit Twister <BitTw...@mouse-potato.com> writes:local/bin
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:/
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.T...@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */
On 03.08.2022 17:49, Keith Thompson wrote:local/bin
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:/
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`.)
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:$PATHexport 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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 403 |
Nodes: | 16 (0 / 16) |
Uptime: | 69:35:36 |
Calls: | 8,423 |
Calls today: | 4 |
Files: | 13,175 |
Messages: | 5,905,367 |