From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Timothee Cour <timothee.cour2@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: `exec env -i OLDPWD=$OLDPWD zsh` doesn't work
Date: Fri, 13 Jan 2017 14:59:19 +0000 [thread overview]
Message-ID: <20170113145919.GB4363@fujitsu.shahaf.local2> (raw)
In-Reply-To: <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?
next parent reply other threads:[~2017-01-13 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAM4j=kO9MSg-72LWog0N3OPumh8jy_xt4_T_fXEXAKQEk3eoXg__31721.773549407$1484300384$gmane$org@mail.gmail.com>
2017-01-13 14:59 ` Daniel Shahaf [this message]
2017-01-13 9:15 Timothee Cour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170113145919.GB4363@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=timothee.cour2@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).