zsh-users
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: source ~/dir/*.zsh
Date: Fri, 22 Jun 2012 10:12:04 +0200	[thread overview]
Message-ID: <87ipej9357.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <-1148869711641803316@unknownmsgid> (TJ Luoma's message of "Thu, 21 Jun 2012 20:01:08 -0400")

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


  reply	other threads:[~2012-06-22  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  0:01 TJ Luoma
2012-06-22  8:12 ` Frank Terbeck [this message]
2012-06-22  8:18 ` René Neumann

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=87ipej9357.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=zsh-users@zsh.org \
    /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).