Re: Can't pipe files to compileHelp
Re: Can't pipe files to compileHelp
- Subject: Re: Can't pipe files to compileHelp
- From: Andy Lee <email@hidden>
- Date: Sun, 4 Aug 2002 10:55:53 -0400
At 10:32 AM -0400 8/4/02, Cameron Hayne wrote:
What's wrong with:
ls *Help.rtf *Help.rtfd | xargs compileHelp -o Help.plist
Note you might need to add the -d option to "ls" because rtfd's are
directories.
But, apart from that, why do you say that xargs is possibly a better way?
Not likely relevant in this case, but xargs has facilities to handle
large amount of input (e.g. lots of Help* files).
I had forgotten about xargs. I think Cameron is right about this
difference. If there is a very large number of arguments in an
expanded command line, I *think* it can exceed some maximum command
length. I'm not sure if this is true in real Unix, but I remember
needing xargs for a makefile I wrote in a Wintel environment.
And it is more general in that you could be generating your list of
Help* filenames in some other way and the xargs solution would still
work.
It seems to me that...
foo | xargs bar
...is equivalent (except for the above-mentioned limitation) to...
bar `foo`
...but there may be some other advantage I'm not aware of. For
example, to be *really* general you'd want to handle filenames that
might contain spaces, and I'm not sure if xargs helps with that (too
lazy to scour the man page).
Also, you might simply find the piping notation easier to read.
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.