Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: path problem when zsh is a login shell
- X-seq: zsh-users 20315
- From: covici@xxxxxxxxxxxxxx
- To: Kurtis Rader <krader@xxxxxxxxxxxxx>
- Subject: Re: path problem when zsh is a login shell
- Date: Tue, 14 Jul 2015 13:57:16 -0400
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CABx2=D-aLSVbQkqy5m7d1YgwKGrM_xj1NZcO2oOYLS4V+C72Pw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <28317.1436890681@ccs.covici.com> <CABx2=D-aLSVbQkqy5m7d1YgwKGrM_xj1NZcO2oOYLS4V+C72Pw@mail.gmail.com>
Thanks for your quick response -- yup, it worked just fine. Now all I
have to do is search prezto and get rid of some of those strange aliases
they have.
Kurtis Rader <krader@xxxxxxxxxxxxx> wrote:
> On Tue, Jul 14, 2015 at 9:18 AM, <covici@xxxxxxxxxxxxxx> wrote:
>
> > I am new to zsh, so please be patient. So if I use zsh as a login shell
> > I have in my /etc/zshenv
> > if [ -e /etc/profile.env ] ; then
> > . /etc/profile.env
> > fi
> > umask 027
> > path=(
> > $PATH
> > )
> >
>
> Don't do that. $PATH is a colon separated sequence of directories. It's a
> single string. When you do the array assignment you are assigning to the
> "path" array a single string. For example, if $PATH is set to "/a:/b:/c"
> when you execute
>
> echo $#path $path
>
> you should see this line printed:
>
> 3 /a /b /c
>
> Now execute
>
> path=( $PATH )
> echo $#path $path
>
> Notice that the path array now contains a single word:
>
> 1 /a:/b:/c
>
> Since you probably don't have a directory named "/a:/b:/c" no non-builtin
> commands will be found.
>
> Also, $path and $PATH are already bound together which means that if you
> change one you're automatically changing the other. In other words, you
> don't need to assign to both of them.
>
> --
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?
John Covici
covici@xxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author