mapfile and proc filesystem, limitation or possible bug
Jim <[email protected]> Mon, 22 Jun 2026 17:51:08 -0500
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CA+rB6GK3uNBh42y5b_XzocQ=CZBTbmXPDYT50iisytS7Q+mTMw__49830.1456261956$1782168794$gmane$org@mail.gmail.com> |
Hello,
ZSH_VERSION: 5.9.1
Is there a limitation with mapfile when it comes to the proc filesystem or
is there a bug?
In a normal directory like $HOME the following work as expected:
% cd $HOME
% print ${(ok)mapfile)
outputs all names
% [[ -v mapfile[.zshrc] ]] && print Found || print Not Found
outputs: Found
% array=("${(f@)${mapfile[.zshrc]%$ā\nā}}")
array is populated
In a proc directory it does not
% cd /proc/$$
% print ${(ok)mapfile)
outputs all names as expected
% [[ -v mapfile[status] ]] && print Found || print Not Found
outputs: Not Found
% array=("${(f@)${mapfile[status]%$ā\nā}}")
array contains one empty element
The man page lists a number of mapfile LIMITATIONS, but I didn't see
anything that I
interpreted as the proc filesystem. If it is a limitation should something
more clear be
added to the manpage?
There are other ways of checking files and getting data from the proc
files, but I was
hoping to determine why mapfile doesn't work.
% print ${(t)mapfile} -> association-hide-hideval-special
% print ${(t)commands} -> association-hide-hideval-special
The above both have the same keywords defining them, and still outputs as
expected.
% [[ -v commands[nvim] ]] && print Found || print Not Found
outputs Found
The only difference I can tell, from my previous examples with mapfile, is
different
filesystem types.
Any clarification would be appreciated.
Regards,
Jim Murphy