From: Tomasz Moskal <ramshackle.industries@gmail.com>
To: zsh-users@zsh.org
Subject: Re: how to refer to basename of $0
Date: Fri, 29 Jul 2011 12:48:03 +0100 [thread overview]
Message-ID: <1311940087.1494.27.camel@localhost.localdomain> (raw)
In-Reply-To: <110728210438.ZM24370@torch.brasslantern.com>
On Thu, 2011-07-28 at 21:04 -0700, Bart Schaefer wrote:
> On Jul 28, 9:39pm, TJ Luoma wrote:
> }
> } Is it even possible to set NAME in .zsh* (and have it return
> } 'test.zsh' or are they called too early in the process?
>
> This is sounding awfully familiar. Oh, it was on zsh-workers, where
> some of the -users crowd would not have seen it.
>
> Starts here:
>
> http://www.zsh.org/mla/workers/2011/msg00159.html
>
> Interesting branch begins here:
>
> http://www.zsh.org/mla/workers/2011/msg00163.html
>
> Particularly:
>
> http://www.zsh.org/mla/workers//2011/msg00172.html
Thanks for the links, but I am still baffled - basename $0 is working
here without any problems:
% cat ~/.zshenv
unsetopt function_argzero
name=`basename $0`
% cat ./foo
#!/bin/zsh
. ~/.zshenv
echo $name
exit 0
% ./foo
foo
Obviously it stops when I comment out unsetopt function_argzero but
with it in place it there is no problems with reporting the script name
- zsh -i / -l / -f make no difference.
Only options I have set in .zshrc are to do with history, basic
completion and prompt (what can I say? I am just getting acquainted with
zsh). Obviously the OPEN_PLAN_OFFICE_NO_VIGILANTE_ATTACKS option is gone
as well. Global zshenv has nothing but path and umask. So as you can see
there is no weirdness in any of the files alas basename $0 do behave
in a different way than described here on on -workers.
What may be the reason of that?
next prev parent reply other threads:[~2011-07-29 11:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 22:55 TJ Luoma
2011-07-28 23:54 ` Tomasz Moskal
2011-07-29 0:24 ` Phil Pennock
2011-07-29 1:30 ` Tomasz Moskal
2011-07-29 0:44 ` Benjamin R. Haskell
2011-07-29 1:39 ` TJ Luoma
2011-07-29 2:06 ` Tomasz Moskal
2011-07-29 4:04 ` Bart Schaefer
2011-07-29 4:50 ` TJ Luoma
2011-07-29 11:48 ` Tomasz Moskal [this message]
2011-07-29 14:08 ` Benjamin R. Haskell
2011-07-29 22:30 ` Bart Schaefer
2011-07-30 19:43 ` Greg Klanderman
2011-07-29 3:05 ` TJ Luoma
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=1311940087.1494.27.camel@localhost.localdomain \
--to=ramshackle.industries@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).