Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parameter expansion

On Apr 1,  8:20am, Rob Hooft wrote:
} Subject: Re: Parameter expansion
} I understand this is a zsh mailinglist, but I find the shell-independent
}   xargs zip backup.zip < index.txt
} more readable, and it gracefully handles the case where index.txt is too
} long for the command line....

Zsh can handle VERY long command lines ... much longer than required to
hold the number of arguments xargs will pass to a single command by
default.  Does

	zip backup.zip file1 file2 ... fileN
	zip backup.zip fileN+1 fileN+2 ... file2N

really do the right thing?  Because that's roughly what'll get executed
if there are enough lines in index.txt.  Even if zip does the right thing
in that case, "xargs tar zcf backup.tar" is a recipe for disaster.

Finally, the whole point of the question was that index.txt contains
file _patterns_, not file names; xargs, by design, won't expand file
patterns, so your solution would fail completely.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Messages sorted by: Reverse Date, Date, Thread, Author