Sourcing a Directory
Matthew S-H
mathbymath at aol.com
Mon Jun 13 04:33:06 UTC 2005
On Jun 12, 2005, at 11:55 PM, ZIYAD A. M. AL-BATLY wrote:
> On Mon, 2005-06-13 at 06:32 +0300, ZIYAD A. M. AL-BATLY wrote:
>> On Sun, 2005-06-12 at 21:45 -0500, Carl Karsten wrote:
>>> Matthew S-H wrote:
>>>> How do I "source" a directory?
>>>> ie: How might I have a line in my "~/.bash_profile" that
>>>> automatically
>>>> runs "source ~/.bash_profile_pieces/*" where the "*" evaluates
>>>> to each
>>>> file in ~/.bash_profile_pieces/"? I tried running it with the
>>>> star and
>>>> it only 'sourced' the first file (alphabetically).
> d="$HOME/.bash_profile_pieces" && find "$d" -type f -print0
> | xargs -0 -i cat {} >"$d/all" && source "$d/all" && rm -f "$d/all"
> (note: you can't use “~” with the quotation marks! Either use “$HOME”
> as above, or remove the quotations but don't use a directory with a
> space(s) in it's name!)
That didn't work either. It said "xargs: illegal option -- i" and
then printed usage info.
More information about the ubuntu-users
mailing list