Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: why doesn't 'source *' work?
- X-seq: zsh-users 2287
- From: Bruce Stephens <bruce@xxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: why doesn't 'source *' work?
- Date: 10 Apr 1999 23:19:06 +0100
- In-reply-to: Timothy J Luoma's message of "Sat, 10 Apr 1999 14:39:04 -0400"
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <199904101839.OAA02885@ocalhost>
Timothy J Luoma <tjlists@xxxxxxxxxxx> writes:
> Is there a reason why 'source *' doesn't work?
>
> Is there a setopt I need to configure?
In what way doesn't it work?
According to the manual:
. file [ arg ... ]
Read commands from file and execute them in the current shell
environment. If file does not contain a slash, or if PATH_DIRS is
set, the shell looks in the components of $path to find the
directory containing file. Files in the current directory are not
read unless `.' appears somewhere in $path.
If any arguments arg are given, they become the positional
parameters; the old positional parameters are restored when the
file is done executing. The exit status is the exit status of the
last command executed.
source is approximately the same as ".".
I'm guessing you missed the bit about the positional parameters.
If you want to source all the files (giving them no parameters),
you'll need to use a loop:
for i in *
do
source $i
done
You could wrap this in an autoloaded function, if you wanted. But not
a shell script, obviously. (Well, probably not.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author