Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
$userdirs empty in non-interactive shells
- X-seq: zsh-workers 42092
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: $userdirs empty in non-interactive shells
- Date: Thu, 7 Dec 2017 11:29:50 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=AhlKn277HsEAcc1J6SoVUn8422+6ErNvOpagv3c2OjM=; b=mmci4joMIh1L0dvpcnI4nja9OFkWZpNbQI5i2lYbBbwoGy/deTeycdMSjvrdpfEEjJ fHhKHuX6ffySevUi9Bf/D9RGxEZSQD52Bgow+ujK8+7rtP2thR9hYznS8OVs5C9DAiUt S0bCEPPWnSXsWrxx8K94wUukbIYfH2o/9VB6j13zpOuJoQcqFs1X740W/0h72Ba4Pk9e wz1L5zkGpGWXyOeNUb8CS6t+9O1kyyIBOM97WxgWcYGexBevezTnqCkcFuj8z517ohxc v67bYa3sqUMY7cIjXFTpmpeCBQPMvsuh4eXzVzDK2+jR0vJ+PDfCPCwR9BHYcsCJ0n2E TeXQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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