From: Clint Priest <cpriest@zsh-users.rxv.me>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Shell sourced function not available to executed script
Date: Sun, 13 Aug 2017 18:15:55 -0500 [thread overview]
Message-ID: <898c3100-52e8-9450-a816-4b029f807067@zsh-users.rxv.me> (raw)
In-Reply-To: <75edf819-b9c7-4466-978b-14331314e92a@zsh-users.rxv.me>
[-- Attachment #1: Type: text/plain, Size: 689 bytes --]
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
next prev parent reply other threads:[~2017-08-13 23:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-13 23:02 Clint Priest
2017-08-13 23:15 ` Clint Priest [this message]
2017-08-13 23:57 ` Bart Schaefer
2017-08-14 1:18 ` Clint Priest
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=898c3100-52e8-9450-a816-4b029f807067@zsh-users.rxv.me \
--to=cpriest@zsh-users.rxv.me \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).