Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: What's the equivalent of ${BASH_SOURCE[0]}?



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