zsh-users
 help / color / mirror / code / Atom feed
From: Timothy J Luoma <tjlists@bigfoot.com>
To: zsh-users@sunsite.auc.dk
Subject: Re: why doesn't 'source *' work?
Date: Sat, 10 Apr 1999 19:49:32 -0400	[thread overview]
Message-ID: <199904102349.TAA03697@ocalhost> (raw)


Replying to message of 10 Apr 1999 23:19:06 +0100
	from Bruce Stephens <bruce@cenderis.demon.co.uk>
	regarding ``Re: why doesn't 'source *' work?''
	
> > Is there a reason why 'source *' doesn't work?

> In what way doesn't it work?

$ cd /Users/tjl/Unix/zsh/source/functions/complex
$ ls
addwhite            df-sort-by-used     oeu
cd                  ej                  pine
cksub               extract-serv        replace-icon
del                 kill                replace-serv
df-sort             lkincds             unimg
df-sort-by-avail    ls-tar              untar
df-sort-by-mount    mv2lbin             verify
df-sort-by-percent  mv2scripts          whois
df-sort-by-size     oaf                 wn-to-rtf
$ which oeu
oeu not found
zsh: exit 1
$ source *
$ which oeu
oeu not found
zsh: exit 1
$ PATH=$PATH:.
$ source *
$ which oeu
oeu not found
zsh: exit 1
$ echo $PATH_DIRS

$

> According to the manual:

> 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.
>
> I'm guessing you missed the bit about the positional parameters.

Or just don't understand what the heck that means.



> 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

even simpler (and seems to work):

for i in ~/Unix/zsh/source/functions/complex/*; source $i

however I still don't understand why 'source *' doesn't accomplish the same  
thing... perhaps I'm a bit dense.


> You could wrap this in an autoloaded function, if you wanted.  But not
> a shell script, obviously.  (Well, probably not.)

I added

for i in ~/Unix/zsh/source/functions/complex/*; source $i

to my .zshenv... that seems to work.


TjL




             reply	other threads:[~1999-04-11  0:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-10 23:49 Timothy J Luoma [this message]
1999-04-11  0:22 ` Bruce Stephens
1999-04-11  0:30   ` Timothy J Luoma
  -- strict thread matches above, loose matches on Subject: below --
1999-04-10 18:39 Timothy J Luoma
1999-04-10 22:19 ` Bruce Stephens

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=199904102349.TAA03697@ocalhost \
    --to=tjlists@bigfoot.com \
    --cc=zsh-users@sunsite.auc.dk \
    /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).