zsh-users
 help / color / mirror / code / Atom feed
* zsh no longer inherit my $PATH.
@ 2013-07-15 20:32 Piotr Karbowski
       [not found] ` <BA95BFDC-5F12-4582-B71B-9ABCD8C7B6B3@gmail.com>
  2013-07-15 21:11 ` Lawrence Velázquez
  0 siblings, 2 replies; 5+ messages in thread
From: Piotr Karbowski @ 2013-07-15 20:32 UTC (permalink / raw)
  To: zsh-users

For some reason zsh scripts no longer preserve $PATH that I modify in my 
.zshrc.

if I do: echo -e '#!/bin/zsh \n echo $PATH' >test.zsh && chmod +x 
test.zsh && ./test.zsh the $PATH is altered, it wasnt as-is

moving PATH altering part to .zshenv does 'fix' it but I would like to 
know how can I restore old behivor.

If I run script with /bin/sh shebang, it will preserve my $PATH and this 
is exacly what I want, but with zsh, which is essential.

-- Piotr.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: zsh no longer inherit my $PATH.
       [not found] ` <BA95BFDC-5F12-4582-B71B-9ABCD8C7B6B3@gmail.com>
@ 2013-07-15 20:47   ` Piotr Karbowski
  2013-07-15 20:58     ` Piotr Karbowski
  0 siblings, 1 reply; 5+ messages in thread
From: Piotr Karbowski @ 2013-07-15 20:47 UTC (permalink / raw)
  To: TJ Luoma; +Cc: zsh-users

On 07/15/2013 10:45 PM, TJ Luoma wrote:
>
>
> On 15 Jul 2013, at 15:32, Piotr Karbowski wrote:
>
> > For some reason zsh scripts no longer preserve $PATH that I modify in
> > my .zshrc.
> >
> > if I do: echo -e '#!/bin/zsh \n echo $PATH' >test.zsh && chmod +x
> > test.zsh && ./test.zsh the $PATH is altered, it wasnt as-is
> >
> > moving PATH altering part to .zshenv does 'fix' it but I would like to
> > know how can I restore old behivor.
> >
> > If I run script with /bin/sh shebang, it will preserve my $PATH and
> > this is exacly what I want, but with zsh, which is essential.
>
>
> Are you on a Mac? If so, try renaming /etc/zprofile to /etc/zshenv
>
>

Nope, Gentoo.

-- Piotr.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: zsh no longer inherit my $PATH.
  2013-07-15 20:47   ` Piotr Karbowski
@ 2013-07-15 20:58     ` Piotr Karbowski
  2013-07-15 22:23       ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Piotr Karbowski @ 2013-07-15 20:58 UTC (permalink / raw)
  To: zsh-users

On 07/15/2013 10:47 PM, Piotr Karbowski wrote:
> On 07/15/2013 10:45 PM, TJ Luoma wrote:
>>
>>
>> On 15 Jul 2013, at 15:32, Piotr Karbowski wrote:
>>
>> > For some reason zsh scripts no longer preserve $PATH that I modify in
>> > my .zshrc.
>> >
>> > if I do: echo -e '#!/bin/zsh \n echo $PATH' >test.zsh && chmod +x
>> > test.zsh && ./test.zsh the $PATH is altered, it wasnt as-is
>> >
>> > moving PATH altering part to .zshenv does 'fix' it but I would like to
>> > know how can I restore old behivor.
>> >
>> > If I run script with /bin/sh shebang, it will preserve my $PATH and
>> > this is exacly what I want, but with zsh, which is essential.
>>
>>
>> Are you on a Mac? If so, try renaming /etc/zprofile to /etc/zshenv
>>
>>
>
> Nope, Gentoo.

Ignore, gentoo bug 19924

-- Piotr.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: zsh no longer inherit my $PATH.
  2013-07-15 20:32 zsh no longer inherit my $PATH Piotr Karbowski
       [not found] ` <BA95BFDC-5F12-4582-B71B-9ABCD8C7B6B3@gmail.com>
@ 2013-07-15 21:11 ` Lawrence Velázquez
  1 sibling, 0 replies; 5+ messages in thread
From: Lawrence Velázquez @ 2013-07-15 21:11 UTC (permalink / raw)
  To: Piotr Karbowski; +Cc: zsh-users

On Jul 15, 2013, at 4:32 PM, Piotr Karbowski <jabberuser@gmail.com> wrote:

> For some reason zsh scripts no longer preserve $PATH that I modify in my .zshrc.
> 
> if I do: echo -e '#!/bin/zsh \n echo $PATH' >test.zsh && chmod +x test.zsh && ./test.zsh the $PATH is altered, it wasnt as-is
> 
> moving PATH altering part to .zshenv does 'fix' it but I would like to know how can I restore old behivor.

Does your /etc/zshenv or .zshenv set $PATH in any way? If they do, that is the $PATH that your zsh scripts will see. Only interactive shells source .zshrc.

vq

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: zsh no longer inherit my $PATH.
  2013-07-15 20:58     ` Piotr Karbowski
@ 2013-07-15 22:23       ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2013-07-15 22:23 UTC (permalink / raw)
  To: Piotr Karbowski; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

On Mon, Jul 15, 2013 at 1:58 PM, Piotr Karbowski <jabberuser@gmail.com>wrote:

>
> Ignore, gentoo bug 19924
>
> -- Piotr.
>
>
What's really stupid about that bug is that whoever made the most recent
change does not appear to have read/understood the comment thread in the
bug tracker, which clearly explains why /etc/zshenv is the WRONG place to
do this.

Well, strictly speaking it's fine to do this in /etc/zshenv PROVIDED that
the environment is changed NON-DESTRUCTIVELY.  In the case of PATH/path,
that means adding missing directories without deleting any that are already
there.

One approach would be to test [[ -o login ]] and set the path
unconditionally when that is true, or add to it when that is false.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-15 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-15 20:32 zsh no longer inherit my $PATH Piotr Karbowski
     [not found] ` <BA95BFDC-5F12-4582-B71B-9ABCD8C7B6B3@gmail.com>
2013-07-15 20:47   ` Piotr Karbowski
2013-07-15 20:58     ` Piotr Karbowski
2013-07-15 22:23       ` Bart Schaefer
2013-07-15 21:11 ` Lawrence Velázquez

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).