zsh-users
 help / color / mirror / code / Atom feed
* lost sysread
@ 2024-05-03 22:42 Ray Andrews
  2024-05-03 23:55 ` Lawrence Velázquez
  0 siblings, 1 reply; 8+ messages in thread
From: Ray Andrews @ 2024-05-03 22:42 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

Any ideas?


0 /aWorking/Zsh/Source/Wk 2 % . test1; print -r -- $(( srand32() ))
srand32:4: command not found: sysread
4

0 /aWorking/Zsh/Source/Wk 2 % exit

0 /aWorking/Zsh/Source/Wk 1 % . test1; print -r -- $(( srand32() ))
3551593729

0 /aWorking/Zsh/Source/Wk 1 % zsh -f
b6-12-Deb12b# . test1; print -r -- $(( srand32() ))
srand32:4: command not found: sysread
4
b6-12-Deb12b# exit

0 /aWorking/Zsh/Source/Wk 1 % . test1; print -r -- $(( srand32() ))
2230494374

... for some unknown reason one of my open shells can find sysread while 
others can't.  I use hibernate, so the OK shell has been open for far 
too long to digress as to which commands might have put it into a 
friendly mood as to sysread.  How on earth do I figure this out?  
Printing out all my variables, there's dozens of differences, but there 
always are.  Any hot prospects? I can't think where I'd even begin.  How 
can a builtin ever not be found? I know sometimes one 'level' of command 
can mask another, like a function 'sysread' might mask the builtin, but 
that's not the case here.  It's not disabled.  Nothing else seems to be 
broken or missing.  No idea.



[-- Attachment #2: Type: text/html, Size: 1654 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-03 22:42 lost sysread Ray Andrews
@ 2024-05-03 23:55 ` Lawrence Velázquez
  2024-05-03 23:57   ` Bart Schaefer
  2024-05-04  1:06   ` Ray Andrews
  0 siblings, 2 replies; 8+ messages in thread
From: Lawrence Velázquez @ 2024-05-03 23:55 UTC (permalink / raw)
  To: zsh-users

On Fri, May 3, 2024, at 6:42 PM, Ray Andrews wrote:
> ... for some unknown reason one of my open shells can find sysread 
> while others can't.

The sysread builtin is provided by the zsh/system module.  You have
to load the module and enable sysread before you can use it.

	zmodload -F zsh/system b:sysread

This has already been done in the shell that works, either by you
or some code you sourced.

-- 
vq


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-03 23:55 ` Lawrence Velázquez
@ 2024-05-03 23:57   ` Bart Schaefer
  2024-05-05  5:23     ` Lawrence Velázquez
  2024-05-04  1:06   ` Ray Andrews
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2024-05-03 23:57 UTC (permalink / raw)
  To: zsh-users

On Fri, May 3, 2024 at 4:56 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
> The sysread builtin is provided by the zsh/system module.  You have
> to load the module and enable sysread before you can use it.
>
>         zmodload -F zsh/system b:sysread

Just
    zmodload zsh/system
will enable all the builtins, it's not actually necessary to
explicitly call out sysread.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-03 23:55 ` Lawrence Velázquez
  2024-05-03 23:57   ` Bart Schaefer
@ 2024-05-04  1:06   ` Ray Andrews
  1 sibling, 0 replies; 8+ messages in thread
From: Ray Andrews @ 2024-05-04  1:06 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]



On 2024-05-03 16:55, Lawrence Velázquez wrote:
> The sysread builtin is provided by the zsh/system module. You have
> to load the module and enable sysread before you can use it.
>
> 	zmodload -F zsh/system b:sysread
>
> This has already been done in the shell that works, either by you
> or some code you sourced.
Never did that knowingly, anyway that fixes it.  I'll keep an eye on 
when/what might be loading that module without my knowledge.




[-- Attachment #2: Type: text/html, Size: 1078 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-03 23:57   ` Bart Schaefer
@ 2024-05-05  5:23     ` Lawrence Velázquez
  2024-05-05 13:17       ` Ray Andrews
  0 siblings, 1 reply; 8+ messages in thread
From: Lawrence Velázquez @ 2024-05-05  5:23 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Fri, May 3, 2024, at 7:57 PM, Bart Schaefer wrote:
> On Fri, May 3, 2024 at 4:56 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>>
>> The sysread builtin is provided by the zsh/system module.  You have
>> to load the module and enable sysread before you can use it.
>>
>>         zmodload -F zsh/system b:sysread
>
> Just
>     zmodload zsh/system
> will enable all the builtins, it's not actually necessary to
> explicitly call out sysread.

Right; I just didn't want to recommend a command that would do more
than absolutely necessary.

-- 
vq


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-05  5:23     ` Lawrence Velázquez
@ 2024-05-05 13:17       ` Ray Andrews
  2024-05-05 15:42         ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Ray Andrews @ 2024-05-05 13:17 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]



On 2024-05-04 22:23, Lawrence Velázquez wrote:
> Just
>>      zmodload zsh/system
>> will enable all the builtins, it's not actually necessary to
>> explicitly call out sysread.
> Right; I just didn't want to recommend a command that would do more
> than absolutely necessary.
Supposing the error msg was: "Module 'sysread' is not loaded"?
>

[-- Attachment #2: Type: text/html, Size: 1041 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-05 13:17       ` Ray Andrews
@ 2024-05-05 15:42         ` Bart Schaefer
  2024-05-05 16:19           ` Ray Andrews
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2024-05-05 15:42 UTC (permalink / raw)
  To: zsh-users

On Sun, May 5, 2024 at 6:17 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> Supposing the error msg was: "Module 'sysread' is not loaded"?

If the module hasn't been loaded yet, how is the shell supposed to
know that sysread isn't an external command?   The whole point of
modules is that the base shell does not have a compiled-in list of all
the possible things that could come from modules.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: lost sysread
  2024-05-05 15:42         ` Bart Schaefer
@ 2024-05-05 16:19           ` Ray Andrews
  0 siblings, 0 replies; 8+ messages in thread
From: Ray Andrews @ 2024-05-05 16:19 UTC (permalink / raw)
  To: zsh-users



On 2024-05-05 08:42, Bart Schaefer wrote:
> On Sun, May 5, 2024 at 6:17 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>> Supposing the error msg was: "Module 'sysread' is not loaded"?
> If the module hasn't been loaded yet, how is the shell supposed to
> know that sysread isn't an external command?   The whole point of
> modules is that the base shell does not have a compiled-in list of all
> the possible things that could come from modules.
Sure, it might not be workable.  Just an idea.  As you say there'd have 
to be some list and that wouldn't be worth the weight.   Or some way of 
quickly scanning what's available:
zmodload --quick-check ... sorta
Not worth it since I suppose one only need bump into the problem once to 
be made wise to 'not found' being sometimes 'not loaded' -- it never 
happened to me before this.  It seems I usually end up with the module 
loaded even tho I don't know exactly where it gets done. I like 
helpfulness but not at the cost of bloat.  Yup, if it couldn't be done 
easily then it's not worth worrying about.

>



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-05-05 16:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03 22:42 lost sysread Ray Andrews
2024-05-03 23:55 ` Lawrence Velázquez
2024-05-03 23:57   ` Bart Schaefer
2024-05-05  5:23     ` Lawrence Velázquez
2024-05-05 13:17       ` Ray Andrews
2024-05-05 15:42         ` Bart Schaefer
2024-05-05 16:19           ` Ray Andrews
2024-05-04  1:06   ` Ray Andrews

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).