zsh - Calling zmodload from a script -


i'm trying understand how zsh modules loaded. according docs:

some optional parts of zsh in modules, separate core of shell. each of these modules may linked in shell @ build time, or can dynamically linked while shell running if installation supports feature. modules linked @ runtime zmodload command.

if startup new shell , run command zmodload displays loaded modules (zsh/datetime is not loaded).

i can load @ run time using zmodload zsh/datetime. if run zmodload again, can see it's listed.

however, when execute script this, zmodload command can't found:

%./testload.zsh  #!/usr/bin/env zsh zmodload zsh/datetime echo "epochseconds: $epochseconds"  ./testload.zsh: line 3: zmodload: command not found 

but, if execute script while invoking new zsh shell, runs successfully:

% zsh testload.zsh  #!/usr/bin/env zsh zmodload zsh/datetime echo "epochseconds: $epochseconds"  epochseconds: 1501004101 

any idea why behavior occurring?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -