On Apr 16, 2009, at 11:00 AM, Chris Cairns wrote:

ok, i was not using any particular "test data" to test my script.
(I will do that next time)
The problem was that what i thought was plain text actually was not plain text. The ampersand (&) character caused the problem. Secondly, there are quite a few characters (and things like spaces, empty lines) which don't go well with shell. I can probably work my way around with applescript to make sure that shell gets the proper text. But i would like to know if shell can do something about such characters.

Yes this is what I meant. You want to "quote" the text string from the shell so it doesn't interpret it as commands. In bash documentation look up " (double quotes) and ' (single quotes).

You've stumbled upon the source of many security holes in lots of software. That is, programmers not handling user input properly as just data and allowing malicious input containing special characters to be treated as commands.

Howard

Reply via email to