Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Can $_ substitute $0 when nofunctionargzero
- X-seq: zsh-users 21634
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Can $_ substitute $0 when nofunctionargzero
- Date: Thu, 9 Jun 2016 18:44:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=vu0FbvlDZzQbx/n7ipm0XfKpdo9tsT7lKWsrWc+XMO0=; b=XfM3CJ+641mFxEibIQJ//iZbnF8TnJzU94/zNonmnvo4eDKKP26PB9dNRIA2sNLCHO 0HA/Fu0/vpLJLoKGC/EUtRprzYapSx5TrJj45eGMy5gia6gi60jBK/MKcHog4fKakRlN Rks4GUfv4tWXEZYU+ge/vgCv8OwmmINdx7x3bM7d59UPQVddV9J6KFufSsb8umbvHBpC 4hd7Pj+mMjhRkHrKBEvLI026j56ur64wVSm2F/cWNsjC5Bhqd7LI+yX9GO48Dd3rZR1D l4lwmwx+/UhZZ5RVatGitHd5QOXAs1Ts6QJoHNC+d/R9yomp8av84SI7Jm8r7Ke8ZN3M LAww==
- 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
Hello,
this (one line):
mkdir -p pathcomponent; echo 'echo "0: $0, _: $_";' >
pathcomponent/sourceme; setopt nofunctionargzero; source
pathcomponent/sourceme
outputs:
0: /bin/zsh, _: pathcomponent/sourceme
So it looks like $_ can take back what nofunctionargzero takes away:
path to sourced file. Normally $0 is used in many plugins, making them
incompatible with nofunctionargzero. Z-sy-h has an explicit check for
this and does:
echo "zsh-syntax-highlighting: error: not compatible with
NO_FUNCTION_ARGZERO" >&2
Can $_ take over? This would mean such scripts can be compatible with
emulate sh and ksh.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author