zsh-users
 help / color / mirror / code / Atom feed
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 20:18:12 -0500	[thread overview]
Message-ID: <97aa8692-1da2-10cc-60fb-ea9edf0c2160@zsh-users.rxv.me> (raw)
In-Reply-To: <CAH+w=7ZZk2EPRbs7X4XVAqPZF31oYuFcTkZ_rjooxiiPqHZjQw@mail.gmail.com>

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


On 8/13/2017 6:57 PM, Bart Schaefer wrote:
> On Sun, Aug 13, 2017 at 4:15 PM, Clint Priest <cpriest@zsh-users.rxv.me> wrote:
>> 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:
>>> In my case, I have a function:
>>>
>>> Which is `source`ed into my environment.
> This is going to depend on which of your startup files contain the
> "source" or "autoload" commands.  Interactive and login shells load a
> different set of ~/.z* files than do scripts.  Scripts typically read
> only /etc/zshenv and ~/.zshenv.  For complete details, "man zsh" and
> read the section on "Startup/Shutdown Files" (or section 5.1 in "info
> zsh" if you have that available).

Makes sense, I'm not sure but I don't think bash behaves in this way.  
No matter, I can follow this pattern as well, thank you.

-- 

-Clint


      reply	other threads:[~2017-08-14  1:18 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
2017-08-13 23:57   ` Bart Schaefer
2017-08-14  1:18     ` Clint Priest [this message]

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=97aa8692-1da2-10cc-60fb-ea9edf0c2160@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).