I’m having a weird issue. I have a console application which I use as a helper. I run this helper app as an authenticated shell but other than that it should be normal.
If I run it by hand the args are split properly but when I run it from inside my main application the parameters are split differently.
Having this line (from the debugger, the exact same command sent to the console app):
./helper --dpath=/opt/local/sbin --cpath=/opt/local/etc/ --tpath=/opt/local/bin --cmd=listUsers
I get this when run from the console:
[code]HELPER-ARGS: ./helper --dpath=/opt/local/sbin --cpath=/opt/local/etc/ --tpath=/opt/local/bin --cmd=listUsers
HELPER-ARG: ./helper (0)
HELPER-ARG: --dpath=/opt/local/sbin (1)
HELPER-ARG: --cpath=/opt/local/etc/ (2)
HELPER-ARG: --tpath=/opt/local/bin (3)
HELPER-ARG: --cmd=listUsers (4)
HELPER-NOTE: tpath is /opt/local/bin, cpath is /opt/local/etc/, dpath is/opt/local/sbin
HELPER-MAIN: listUsers
listUsers: tpath is /opt/local/bin, cpath is /opt/local/etc/
HELPER-EXEC:/opt/local/bin/useredit -L -s “/opt/local/etc/”/users.conf
eduo:501:Eduardo Gutierrez[/code]
But when I run it as a helper of my desktop app, as an authenticated shell, I get this:
app.debug[75251]: app: /Users/eduo/Builds/app.debug.app/Contents/Resources/app_wrapper/helper --dpath="/opt/local/sbin" --cpath="/opt/local/etc/" --tpath="/opt/local/bin" --cmd=listUsers --params=1
authexec[75319]: executing /Users/eduo/Builds/app.debug.app/Contents/Resources/app_wrapper/helper
helper[75319]: HELPER-ARGS: /Users/eduo/Builds/app.debug.app/Contents/Resources/app_wrapper/helper --dpath=/opt/local/sbin --cpath=/opt/local/etc/ --tpath=/opt/local/bin --cmd=listUsers --params=1
helper[75319]: HELPER-ARG: /Users/eduo/Builds/app.debug.app/Contents/Resources/app_wrapper/helper (0)
helper[75319]: HELPER-ARG: --dpath=/opt/local/sbin --cpath=/opt/local/etc/ --tpath=/opt/local/bin (1)
helper[75319]: HELPER-ARG: --cmd=listUsers (2)
helper[75319]: HELPER-ARG: --params=1 (3)
helper[75319]: HELPER-NOTE: tpath is , cpath is , dpath is/opt/local/sbin --cpath
helper[75319]: HELPER-MAIN: listUsers
helper[75319]: listUsers: tpath is , cpath is
helper[75319]: HELPER-EXEC:/useredit -L -s ""/users.conf
As you can see, the arguments are mangled in the second case, where three of them falling on the same one, and the last one separate.
Any ideas? I searched the old and new forums but either didn’t do it right or there’s no thread for it.