From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13859 invoked by alias); 22 Jun 2012 08:22:05 -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: 17155 Received: (qmail 7761 invoked from network); 22 Jun 2012 08:22:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: Zsh-Users List Subject: Re: source ~/dir/*.zsh In-Reply-To: <-1148869711641803316@unknownmsgid> (TJ Luoma's message of "Thu, 21 Jun 2012 20:01:08 -0400") References: <-1148869711641803316@unknownmsgid> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Fri, 22 Jun 2012 10:12:04 +0200 Message-ID: <87ipej9357.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: [pbs]MzQ5NTM4 TJ Luoma wrote: > My idea was to put them all into a special directory and then source > them like so in ~/.zshenv > > source ~/dir/*.f.zsh > > But that doesn't seem to work. You'll have to use a for loop, because this is not how `source' works (see below). > I'm not getting any errors, it just doesn't seem to actually do anything. It should source *one* file: source file [ arg ... ] Same as `.', except that the current directory is always searched and is always searched first, before directories in $path. . file [ arg ... ] Read commands from file and execute them in the current shell environment. [...] If any arguments arg are given, they become the positional parameters; the old positional parameters are restored when the file is done executing. [...] So, if you'd add a line printf '%s\n' "$@" to the top of the alphabetically first file in the directory, it should print the names of the other files because `source' will put them into the positional parameters during the execution of the first file. Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925