Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: `exec env -i OLDPWD=$OLDPWD zsh` doesn't work
- X-seq: zsh-users 22363
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Timothee Cour <timothee.cour2@xxxxxxxxx>
- Subject: Re: `exec env -i OLDPWD=$OLDPWD zsh` doesn't work
- Date: Fri, 13 Jan 2017 14:59:19 +0000
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=TOffVeTtj5MY9PT yN3AkzF5MdYc=; b=yEdDNindeV5BOC5Ey1dRIKFAxj6BQhmeAgErMguwSQfg3DW 6YD0tT5agapqXdUofZrq+b3RzbuV0+RwTo0yOURoZam1W1OG/Sr39oXeEjgamU4o 3fjHiqyuHPoWDhCsPKCtyjKAlolOJRp9kghVhw4hSx/K6hyRCZnwBlYPLQB8=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=TOffVeTtj5MY9P TyN3AkzF5MdYc=; b=axBTBIiZvLSogR0VsVWquajmSREMU/DmcGPPBTzuc/vjGI wMZWjPlPm6Np7wwOsj+yVPCaaggmzKRwEZQsRGn88xcvaAT4jnUEKZjpbI+iDt1D Zzrq1yl1g1jhvdcPzYtqYGF3mbkHhVmA4JmfY87+0x165Euroeg2zSewoh2Rk=
- In-reply-to: <CAM4j=kO9MSg-72LWog0N3OPumh8jy_xt4_T_fXEXAKQEk3eoXg__31721.773549407$1484300384$gmane$org@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: <CAM4j=kO9MSg-72LWog0N3OPumh8jy_xt4_T_fXEXAKQEk3eoXg__31721.773549407$1484300384$gmane$org@mail.gmail.com>
Timothee Cour wrote on Fri, Jan 13, 2017 at 01:15:27 -0800:
> how do i exec while passing OLDPWD?
You could pass it under some other name:
exec env -i MY_OLDPWD=$OLDPWD zsh
but it's probably easier to do:
(cd -- "$OLDPWD" && exec env -i NEWPWD=... zsh)
and have the new zsh cd to $NEWPWD.
> related [but for bash]:
> http://unix.stackexchange.com/questions/242909/why-does-bash-clear-oldpwd-when-a-child-script-is-started
> QUOTE: It seems reasonable to inherit OLDPWD if it names a directory, in
> the same way that the shell inherits PWD if it names the current directory,
> so we'll try that for the next bash version.
Observation: making this change would change the behaviour of `cd -` in
interactive subshells.
What's the use-case for this?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author