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

RE: Re: ls completion



Haai,

On Tue, 04 Jun 2024 13:34:54 +0100, Thomas Lauer <thomas.lauer@xxxxxxxxxx> wrote:
> (Nowadays I call these helpers ls0, or ls00, but back then I was a
> complete 100% newbie whereas today I am just a 98% newbie... Big
> progress :-) ).

Don't blame yourself -- the lack of a dedicated, singular naming
convention for local objects has become quite a problem in UNIX (at
least in terms of the mess it creates).

In the end, w/ all kinds of possibilities being reserved, me ended up
w/ the convention 'ls_' -- w/ the underscore at the end, since also in
many non-zsh contexts, names w/ a preceding underscore are already
reserved for ``underfloor'' system use.

This is not elegant. (Me's also been using the 'ls0' numbers convention,
but to me, that implies a lower-level version of the routine, not a
higher-level one; and what about programs w/ names like 'doom2'? Should
the wrapper be called 'doom20'? <g>).

There's also the related problem of there being no record, upon exec(3)
(or, rather, execve(2)), of where in the PATH array the executable was
encountered, so that wrapper programs would have to pull all kinds of
tricks to properly invoke the underlying program (to prevent the
wrapper script from executing itself again instead); understandably, at
that point, coders usually bail out and include the full path to the
intended program.

At least zsh *somewhat* mitigates this by having a 'command' modifier
that actually forces it to use ${PATH}, but that only helps when, as in
your case, the wrapper routine (or alias) is confined to the shell.

Mein 2 Groschen.

       --zeurkous.

-- 
Friggin' Machines!




Messages sorted by: Reverse Date, Date, Thread, Author