Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What's the equivalent of ${BASH_SOURCE[0]}?
- X-seq: zsh-users 29740
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: What's the equivalent of ${BASH_SOURCE[0]}?
- Date: Sat, 16 Mar 2024 05:59:56 -0600
- Archived-at: <https://zsh.org/users/29740>
- In-reply-to: <CAN=4vMo+W9=KT9EOWB0DwovfAiWW1R63ERiMTi2qoOX8YjO_3g@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP44s3JuCYoNYQEgVUMwPLwGb7AJSzFF=KLe00v0g_q0z1Kaw@mail.gmail.com> <CAH+w=7YedsQCk56Bvygc_NvsByDJf_MWK57XZYEoO4Xtx1eXww@mail.gmail.com> <CAMP44s0nmNB7zXorO1Vh7sPGQqATv46p8+c7Pn7_0r-1FAPNqw@mail.gmail.com> <CAN=4vMo+W9=KT9EOWB0DwovfAiWW1R63ERiMTi2qoOX8YjO_3g@mail.gmail.com>
On Sat, Mar 16, 2024 at 3:43 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Fri, Mar 15, 2024 at 5:29 PM Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
> >
> > Actually I realized that it's ${(%):-%x} what I'm looking for, since
> > that is the best equivalent for ${BASH_SOURCE[0]}.
> >
> > According to StackOverflow there are no better options [1].
>
> Better in what sense? What are the shortfalls of ${(%):-%x} from your
> point of view?
There aren't any shortfalls, it works fine. It's just complicated.
Given that this seems to be commonly used I just thought perhaps there
was something straightforward like $ZSH_SOURCE.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author