Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: source ~/dir/*.zsh
- X-seq: zsh-users 17155
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: source ~/dir/*.zsh
- Date: Fri, 22 Jun 2012 10:12:04 +0200
- In-reply-to: <-1148869711641803316@unknownmsgid> (TJ Luoma's message of "Thu, 21 Jun 2012 20:01:08 -0400")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <-1148869711641803316@unknownmsgid>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author