Sourcing a Directory

Matthew S-H mathbymath at
Mon Jun 13 07:24:27 UTC 2005

Again, it didn't work.  This time it gave the following error and  
then printed usage information:
"xargs: illegal option -- -"


On Jun 13, 2005, at 1:13 AM, ZIYAD A. M. AL-BATLY wrote:
> On Mon, 2005-06-13 at 00:33 -0400, Matthew S-H wrote:
>> That didn't work either.  It said "xargs: illegal option -- i" and
>> then printed usage info.
> That's weird!! It DID work for me!  Here's a quote from “man xargs”:
>         --replace[=replace-str], -i[replace-str]
>                 Replace occurences of replace-str in the initial
>                 arguments with names read from standard input.  Also,
>                 unquoted blanks do not terminate arguments.  If
>                 replace-str is omitted, it defaults to "{}" (like for
>                 ‘find -exec’).  Implies -x and -l 1.
> The output of “xargs --version”:
>         GNU xargs version 4.1.20
> Also note that I'm using “bash” which is the default shell in Ubuntu
> (other shells may need some adjustments to make this work).
> Another solution:  Change “-i” to “--replace={}” and see what happens.
> Also, make sure that “-0” is the first argument to “xargs”
> Here's the command again in several lines (I'm thinking that your mail
> reader didn't display it correctly as mine (Evolution) didn't!):
>         d="$HOME/.bash_profile_pieces" &&\
>         find "$d" -type f -print0 |\
>         xargs -0 --replace={} cat {} >"$d/all" &&\
>         source "$d/all" &&\
>         rm -f "$d/all"
> Just type them as above.  “bash” will allow you to enter more than one
> line if it ends with “\” before it starts to execute the commands.
> Again, it DID work for me!  I created a directory “~/.T” and put two
> files in it with some “variable=value” and “alias”(es) and it worked.
> If it didn't work with you post the output of “xargs --help” and the
> output of “xargs --version”
> I hope it'll work with you.
> Ziyad.
> -- 
> ubuntu-users mailing list
> ubuntu-users at

More information about the ubuntu-users mailing list