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

$userdirs empty in non-interactive shells



Hi,

$userdirs seems to only work in interactive shells. That seems
to be due to:

> mod_export void
> adduserdir(char *s, char *t, int flags, int always)
> {
>     Nameddir nd;
>     char *eptr;
>
>     /* We don't maintain a hash table in non-interactive shells. */
>     if (!interact)
>         return;

Why? It seems to me it would make as much sense to hash it in
non-interactive shells. It may be useful to be able to flush
that cache though.

Note that upon expanding $userdirs in non-interactive shells,
the code still loops over the pw entries.

So, if we don't want to change the behaviour, we may still want
to disable $userdirs altogether in non-interactive shells (and
update the documentation).

-- 
Stephane



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