10-04-04 11:01 PM
D. Alvarado wrote:
> Hello,
> I am running Solaris 8 and using ksh. I am trying to add some html
> files to an existing zip archive. The problem is, some of the zip
> files contain spaces in the file name. So when I try
>
> find "$filename" -name "*.html" | xargs zip -r "$basename.zip"
I'm not sure if this was implemented in solaris 8 (I've only got access
to solaris 9 - and this feature is available there), but have a look for
find ... -print0 and xargs -0 (zero). These print and parse the file
names null-terminated, so spaces are no longer an issue. (An old GNU
feature which has been in most mainstream uni*s for quite a while now).
To use your example:
find "$filename" -name \*.html -print0 | xargs -0 zip -r "$basename.zip"
($filename should of course be a $directory, but you knew that right? ;-)
Good luck,
Steve
[ Post a follow-up to this message ]
|