From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16332 invoked by alias); 13 Jan 2017 15:02:50 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22363 Received: (qmail 9028 invoked from network); 13 Jan 2017 15:02:50 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.26):SA:0(-0.7/5.0):. Processed in 1.156414 secs); 13 Jan 2017 15:02:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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= X-ME-Sender: X-Sasl-enc: ocO5F6KrwvcZaZhRjoZFd+0Hadx7YGKyZT5tG/Bwx2ot 1484319766 Date: Fri, 13 Jan 2017 14:59:19 +0000 From: Daniel Shahaf To: Timothee Cour Cc: Zsh Users Subject: Re: `exec env -i OLDPWD=$OLDPWD zsh` doesn't work Message-ID: <20170113145919.GB4363@fujitsu.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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?