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

Re: Shell sourced function not available to executed script



It would also seem that 'autoloaded functions' are also not available from executed scripts... I created it as an autoloaded function and it works from the CLI just fine.

On 8/13/2017 6:02 PM, Clint Priest wrote:
I could be wrong, but I swear that a function declared in my shell environment was available to another script executed from the CLI.

In my case, I have a function:

pv() {
    echo "\$$1='${(P)1}'";
}

Which is `source`ed into my environment. I could type pv PATH and it would echo:
$PATH='...'

However when I run another script with executability set, shebang is #!/bin/zsh it tells me pv is not available.

Any ideas?


--

-Clint



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