From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7497 invoked by alias); 14 Aug 2017 01:18:22 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22822 Received: (qmail 6045 invoked by uid 1010); 14 Aug 2017 01:18:22 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.28):SA:0(-0.7/5.0):. Processed in 0.707715 secs); 14 Aug 2017 01:18:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: cpriest@zsh-users.rxv.me X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=vDd+ox3JtJksisNlGu BDXrWaFdCnWXJhah0uTmlVa1g=; b=UNTlVA8ewn1yhXWYFZ5iMlq2vnGV4mDn8a +Nuc43xWxP7mTeNcfrXSiugnp3fMavRGE2QM3TPLzlQq1H3j0HPPDKNn4T3nm828 2wyyTmg5seuBHN9VeMnwbDxLCbapvUa9NqbgZK9wkGKNhejHFRUlcUKAygoOiIlc Yj8R2NtjMDz4Vga3nFbU4ibfqMWhnDZKgUv0F30XG6qPSNzq63Z+tzjD59ckUdeC Z0WHkln9vqZYNb36+sQUM5BYFoLvZfenlhDehfUhkPuOuHeeyVdQgk2uvlzz+d+9 9bAA6uKqGbgsuJVFY/j9ZNOKuk0qlKCHYKVWpmni9+1yJbrdyVaQ== X-ME-Sender: X-Sasl-enc: bo4cdXx3OeJ/nnEfDOocHYESKKJdZCI8El7x5muOqCJE 1502673498 Subject: Re: Shell sourced function not available to executed script To: Zsh Users References: <75edf819-b9c7-4466-978b-14331314e92a@zsh-users.rxv.me> <898c3100-52e8-9450-a816-4b029f807067@zsh-users.rxv.me> From: Clint Priest Message-ID: <97aa8692-1da2-10cc-60fb-ea9edf0c2160@zsh-users.rxv.me> Date: Sun, 13 Aug 2017 20:18:12 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------06BDACADF8B86EAE367A7009" Content-Language: en-US --------------06BDACADF8B86EAE367A7009 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 8/13/2017 6:57 PM, Bart Schaefer wrote: > On Sun, Aug 13, 2017 at 4:15 PM, Clint Priest 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 --------------06BDACADF8B86EAE367A7009--