Sean Harre
7/21/2006 4:50:00 PM
Ok, I understand the reason this works the way it does - Ruby wants the
shell to handle any special characters that may result in
substitutions/matching, etc. That makes sense. But is there an "official
workaround" for this problem? And if not, can I rest well at night with
my '\n' workaround in my companys stable source tree? It's just a
warning message now, but in the future, I can't really forsee any
problems with putting a CR at end of exec_str, but...
Thanks,
-Sean
ts wrote:
>>>>>>"S" == Sean Harre <sharre@transmeta.com> writes:
>>>>>>
>>>>>>
>
>S> exec_str = "./foo.pl test\n"
>S> exec(exec_str)
>
>S> Anyone have an idea why this works?
>
> When ruby find some special characters (like \n;[]{} ...) in the string, it
> call the shell (/bin/sh -c) rather than trying to exec directly the
> program. In this case it don't test the variable PATH
>
>
>
>Guy Decoux
>
>
>
>
>