Oron Peled wrote:
On Tuesday 19 October 2004 09:33, [EMAIL PROTECTED] wrote:

Yedidyah Bar-David wrote:

That's wrong. If /tmp/tmp-sms contains multiple lines then sendsms
would be invoked separatly for each one of them.

You are right - multiple lines will result in multiple command line arguments, not necessarily


multiple invocations.


Hmmm... interesting. Look at that input:

  $ cat /tmp/t
  me "Shlomo" "hello there,
  how are you"

It's a multiline [but properly quoted] message. Let's try xargs:

  $ xargs cat < /tmp/t
  xargs: unmatched double quote

And now let's try my prior suggestion:

  $ eval cat "`cat /tmp/t`"
  cat: me: No such file or directory
  cat: Shlomo: No such file or directory
  cat: hello there, how are you: No such file or directory

See how cat(1) got exactly the wanted 3 arguments?

Seems like I just won the bash-judo :-)


I'm not sure who you addressed this to, but that's basically the other side of the point I was making - back-quotes eventually flaten the lines and allow the shell to include the entire file as a single command-line argument, while xargs by definition will pass each input line as a separate command line argument, regardless of quotation marks in the input.

--Amos

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to