What is the difference between $path and $PATH (lowercase versus uppercase) with zsh?Share aliases and PATH setting between zsh and bashWhat is the difference between PATH and LD_LIBRARY_PATH?What is the key difference between grml zsh config and oh-my-zsh configZSH: What's the difference between `.` and `source`?What is the difference between `autoload` and `autoload -U` in Zsh?In zsh, what's the difference between &! and &|?What is the difference between “echo $PATH” and /etc/paths?what's the difference between /bin/zsh and /usr/bin/zsh?Can't load antigen in zsh - my source command always gets an extra “/bin” appendedWhat is the difference between “…”, '…', $'…', and $“…” quotes?
Character Frequency in a String
Are gangsters hired to attack people at a train station classified as a terrorist attack?
how to add 1 milliseconds on a datetime string?
Why do websites not use the HaveIBeenPwned API to warn users about exposed passwords?
What is a reasonable time for modern human society to adapt to dungeons?
Grid/table with lots of buttons
How to optimize IN query on indexed column
"I you already know": is this proper English?
What to do when you reach a conclusion and find out later on that someone else already did?
Terence Tao - type books in other fields?
Are glider winch launches rarer in the USA than in the rest of the world? Why?
How to write a sincerely religious protagonist without preaching or affirming or judging their worldview?
What does Kasparov mean here?
Determine if a triangle is equilateral, isosceles, or scalene
Film where a boy turns into a princess
How do I run a game when my PCs have different approaches to combat?
What is a Union Word™?
No-cloning theorem does not seem precise
How can I stop myself from micromanaging other PCs' actions?
Memory capability and powers of 2
The seven story archetypes. Are they truly all of them?
Area of parallelogram = Area of square. Shear transform
Is it normal practice to screen share with a client?
What is the purpose of the fuel shutoff valve?
What is the difference between $path and $PATH (lowercase versus uppercase) with zsh?
Share aliases and PATH setting between zsh and bashWhat is the difference between PATH and LD_LIBRARY_PATH?What is the key difference between grml zsh config and oh-my-zsh configZSH: What's the difference between `.` and `source`?What is the difference between `autoload` and `autoload -U` in Zsh?In zsh, what's the difference between &! and &|?What is the difference between “echo $PATH” and /etc/paths?what's the difference between /bin/zsh and /usr/bin/zsh?Can't load antigen in zsh - my source command always gets an extra “/bin” appendedWhat is the difference between “…”, '…', $'…', and $“…” quotes?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In FreeBSD 12, using the zsh
shell, I noticed this difference when looking at $path
(lowercase) versus $PATH
(uppercase).
echo $path
/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/home/freebsd/bin
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/freebsd/bin
One output is delimited by SPACE character, the other by COLON character.
➥ Why the difference?
Are these two different, separate variables? Or does the lowercase/uppercase trigger some kind of trick or meaning I do not know about?
Is this a zsh
feature? Or a feature of FreeBSD?
zsh variable path array
add a comment |
In FreeBSD 12, using the zsh
shell, I noticed this difference when looking at $path
(lowercase) versus $PATH
(uppercase).
echo $path
/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/home/freebsd/bin
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/freebsd/bin
One output is delimited by SPACE character, the other by COLON character.
➥ Why the difference?
Are these two different, separate variables? Or does the lowercase/uppercase trigger some kind of trick or meaning I do not know about?
Is this a zsh
feature? Or a feature of FreeBSD?
zsh variable path array
add a comment |
In FreeBSD 12, using the zsh
shell, I noticed this difference when looking at $path
(lowercase) versus $PATH
(uppercase).
echo $path
/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/home/freebsd/bin
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/freebsd/bin
One output is delimited by SPACE character, the other by COLON character.
➥ Why the difference?
Are these two different, separate variables? Or does the lowercase/uppercase trigger some kind of trick or meaning I do not know about?
Is this a zsh
feature? Or a feature of FreeBSD?
zsh variable path array
In FreeBSD 12, using the zsh
shell, I noticed this difference when looking at $path
(lowercase) versus $PATH
(uppercase).
echo $path
/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/home/freebsd/bin
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/freebsd/bin
One output is delimited by SPACE character, the other by COLON character.
➥ Why the difference?
Are these two different, separate variables? Or does the lowercase/uppercase trigger some kind of trick or meaning I do not know about?
Is this a zsh
feature? Or a feature of FreeBSD?
zsh variable path array
zsh variable path array
edited 8 hours ago
Gilles
566k136 gold badges1163 silver badges1673 bronze badges
566k136 gold badges1163 silver badges1673 bronze badges
asked 8 hours ago
Basil BourqueBasil Bourque
4264 silver badges15 bronze badges
4264 silver badges15 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
That's a feature of zsh
inherited from csh
/tcsh
.
The $path
array variable is tied to the $PATH
scalar (string) variable. Any modification on one is reflected in the other.
In zsh
(contrary to (t)csh
), you can tie other variables beside $PATH
with typeset -T
. It's conventional, but not mandatory, to use an uppercase name for the colon-separated scalar and the same name in lowercase for the array. While colon is the default separator, other separators can be used (for instance newline to tie a multi-line string to an array, or comma to tie a csv row to an array)
In recent versions of zsh
, typeset -p PATH
or typeset -p path
shows the link between the two variables:
% typeset -p path
typeset -aT PATH path=( /home/chazelas/bin /usr/local/bin /usr/bin /bin )
That's useful in that it makes it easier to add remove components or loop over them.
Doing a typeset -U path
to make the elements unique also helps keeping the $PATH
variable clean (something similar can be achieved in tcsh
with set -f
).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532148%2fwhat-is-the-difference-between-path-and-path-lowercase-versus-uppercase-with%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
That's a feature of zsh
inherited from csh
/tcsh
.
The $path
array variable is tied to the $PATH
scalar (string) variable. Any modification on one is reflected in the other.
In zsh
(contrary to (t)csh
), you can tie other variables beside $PATH
with typeset -T
. It's conventional, but not mandatory, to use an uppercase name for the colon-separated scalar and the same name in lowercase for the array. While colon is the default separator, other separators can be used (for instance newline to tie a multi-line string to an array, or comma to tie a csv row to an array)
In recent versions of zsh
, typeset -p PATH
or typeset -p path
shows the link between the two variables:
% typeset -p path
typeset -aT PATH path=( /home/chazelas/bin /usr/local/bin /usr/bin /bin )
That's useful in that it makes it easier to add remove components or loop over them.
Doing a typeset -U path
to make the elements unique also helps keeping the $PATH
variable clean (something similar can be achieved in tcsh
with set -f
).
add a comment |
That's a feature of zsh
inherited from csh
/tcsh
.
The $path
array variable is tied to the $PATH
scalar (string) variable. Any modification on one is reflected in the other.
In zsh
(contrary to (t)csh
), you can tie other variables beside $PATH
with typeset -T
. It's conventional, but not mandatory, to use an uppercase name for the colon-separated scalar and the same name in lowercase for the array. While colon is the default separator, other separators can be used (for instance newline to tie a multi-line string to an array, or comma to tie a csv row to an array)
In recent versions of zsh
, typeset -p PATH
or typeset -p path
shows the link between the two variables:
% typeset -p path
typeset -aT PATH path=( /home/chazelas/bin /usr/local/bin /usr/bin /bin )
That's useful in that it makes it easier to add remove components or loop over them.
Doing a typeset -U path
to make the elements unique also helps keeping the $PATH
variable clean (something similar can be achieved in tcsh
with set -f
).
add a comment |
That's a feature of zsh
inherited from csh
/tcsh
.
The $path
array variable is tied to the $PATH
scalar (string) variable. Any modification on one is reflected in the other.
In zsh
(contrary to (t)csh
), you can tie other variables beside $PATH
with typeset -T
. It's conventional, but not mandatory, to use an uppercase name for the colon-separated scalar and the same name in lowercase for the array. While colon is the default separator, other separators can be used (for instance newline to tie a multi-line string to an array, or comma to tie a csv row to an array)
In recent versions of zsh
, typeset -p PATH
or typeset -p path
shows the link between the two variables:
% typeset -p path
typeset -aT PATH path=( /home/chazelas/bin /usr/local/bin /usr/bin /bin )
That's useful in that it makes it easier to add remove components or loop over them.
Doing a typeset -U path
to make the elements unique also helps keeping the $PATH
variable clean (something similar can be achieved in tcsh
with set -f
).
That's a feature of zsh
inherited from csh
/tcsh
.
The $path
array variable is tied to the $PATH
scalar (string) variable. Any modification on one is reflected in the other.
In zsh
(contrary to (t)csh
), you can tie other variables beside $PATH
with typeset -T
. It's conventional, but not mandatory, to use an uppercase name for the colon-separated scalar and the same name in lowercase for the array. While colon is the default separator, other separators can be used (for instance newline to tie a multi-line string to an array, or comma to tie a csv row to an array)
In recent versions of zsh
, typeset -p PATH
or typeset -p path
shows the link between the two variables:
% typeset -p path
typeset -aT PATH path=( /home/chazelas/bin /usr/local/bin /usr/bin /bin )
That's useful in that it makes it easier to add remove components or loop over them.
Doing a typeset -U path
to make the elements unique also helps keeping the $PATH
variable clean (something similar can be achieved in tcsh
with set -f
).
edited 7 hours ago
answered 8 hours ago
Stéphane ChazelasStéphane Chazelas
326k57 gold badges634 silver badges1001 bronze badges
326k57 gold badges634 silver badges1001 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532148%2fwhat-is-the-difference-between-path-and-path-lowercase-versus-uppercase-with%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown