Quote Originally Posted by jamadagni View Post
Why?
I have no idea.

I have added quotes in my script, as you see.
I guess the quotes were treated as part of the argument and not as a "whitespace escaper" (sorry, can't find a better name for it at this hour). This may have something to do with how the $() construction works. I have never seen it before, so I can't say.

Why is it that if I pass it directly using $() I get unexpeted behaviour?
Treat it as you would have passed:

./datefmt.py +\"foo%n%F %R\" (quotes get escaped)