From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2600 invoked by alias); 9 Sep 2017 21:38:20 -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: 22875 Received: (qmail 15077 invoked by uid 1010); 9 Sep 2017 21:38:20 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f169.google.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(209.85.192.169):SA:0(-4.2/5.0):. Processed in 3.664024 secs); 09 Sep 2017 21:38:20 -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=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: eric.pruitt@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:pgp-key:user-agent; bh=A1ZCjrLc5V++l8BHZ0AviWCUDbIujUYiMB2FkOlw1fY=; b=MK+gjEp1NA7kdYS/ku1NPPsW4A4UPlug8C9BAnyM46IdvQ4m2Oo9Z9jqha7djDV7gA QhHXBygnlNEo3D0xLtkboc6Caaa7JQYLCGIxBVK2rhc+9/cOK6mwcdKL5vuLFggz4S9Q uW5e6M5pjvv0fGUGd3IjcZWvR8cvlswCxhVd7zRLmDsyQlNyjZOcem08rV4wWD3n+nBP L4tZ/J00Ur1HYBkAZCe0J0LoOa0/v50VkqQB+QTLZFQqZdTkZtinU/LIFv6IHPcXTEA2 Nef9GylQoqeXG5X7SCg0lp5AXWTrCMFK0vpQxjmVpxZm35mDksb6Q4sBS+RNFTgTHm8O prEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:pgp-key:user-agent; bh=A1ZCjrLc5V++l8BHZ0AviWCUDbIujUYiMB2FkOlw1fY=; b=DpyMZAJdDn0sWd9kCyXDHiNjmi4Tv6I13FfI6UHYs1HaXpB6dC4AfWi1wqs3B4xZ+V 2M9FCR2B7ycFGBhpnhDt4sZa2BWAk9zzd3z0z1JsHc5BAp8CTNEzKwvVEkhHqqOtGZRE UxDW8XLsEFAK+9w0KKC1z5zY08tSEC/xqrdiV+qXXwxJdgJ7FzHV+/XAYORQ01HxERKy rpYHB7Z3fNbVB+o8wcJ5kQar8Us7T5tTXeyJIcVDfHl8paN55SZqOzlgyStN/aEsuu5m AHgW8XExvy9PCVLUsoYKl4RCDYNYpW0/B8yJdXBshLr6JmZ+94cNhw+KfRafcgTQhcIO pxCQ== X-Gm-Message-State: AHPjjUjVnYuIYZwWyhelc0vBeeNTXs5mdiWtYTopCEnDe0J5qYFFtMOo 97P3pCrO5AZEonUN X-Google-Smtp-Source: ADKCNb41WDr1INqwVZ2HxV0ZDv+qzlr25F4RH6Iy5pIkftgGT5jkfQQpm7mudaa4v65wz4+mjFBUVQ== X-Received: by 10.98.155.76 with SMTP id r73mr7349566pfd.182.1504993088407; Sat, 09 Sep 2017 14:38:08 -0700 (PDT) Date: Sat, 9 Sep 2017 14:38:06 -0700 From: Eric Pruitt To: zsh-users@zsh.org Subject: Re: Running "unset path" breaks PATH despite emulation being enabled Message-ID: <20170909213806.52qezvyk766loeg3@sinister.lan.codevat.com> References: <20170908082917.v5j4vczoq75vs5lk@sinister.lan.codevat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: PGP-Key: https://www.codevat.com/pgp.asc#F8601B5D2511B4C3535232488DDDE2E6053692AB User-Agent: NeoMutt/20170113 (1.7.2) I'm moving this discussion from zsh-workers to zsh-users since it's been established that the behavior I observed isn't necessarily a bug. On Fri, Sep 08, 2017 at 01:30:05PM +0200, Mikael Magnusson wrote: > This works fine if you start zsh as sh though, ie either make a > symlink ln -s =zsh sh; ./sh or do ARGV0=sh zsh > It can't really work in the 'emulate sh' case since the parameter > $path is then already created and it would be quite controversial for > emulate to remove parameters from the shell environment. What I ended up doing is adding this to the top of my script: test "${ZSH_NAME:-sh}" = "sh" || exec -a sh zsh "$0" "$@" I would like to replace "zsh" with the absolute path of the Z shell interpreter in case the "zsh" being executed is not the first one listed in a $PATH folder. After reading through some documentation and reviewing the output of "set", I don't see a way to do this. For comparison, Bash sets $BASH to the interpreter's path: ~$ echo $BASH /home/ericpruitt/.local/bin/bash Is there a similar value in Z shell or a built-in I can use? Thanks, Eric