Hi all,
I use Call DSExecute("UNIX",myCommand, Output, ErrCode) to execute system command. but i find that if myCommand consists of double quote(") and single quote(') ..mostly as script argument....and it always fail to run.
e.g.
myCommand is testing.sh "hello '1234'"
i use "testing.sh ":'"':"hello '1234'":'"' to concat the command
and when i print out it is ok..but when i execute it seems the argument cannot be passed.
Thanks,
Cal
DSExecute problem
Moderators: chulett, rschirm, roy
Cal
You do not need to quote your arguments unless there is a space in the argument value.
Kim.
Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
You do not need to quote your arguments unless there is a space in the argument value.
Kim.
Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
Cal
in fact I also sometimes feel the need to quote things, e.g. an email subject that contains blanks or an enumeration.
It's usually helpful to first decide on which quotation mark to use on inner and outer quotation (" or '). If you want to use parameter evaluation should choose " as inner quotation mark.
I would try your example like this:
"testing.sh ":"'":"hello 1234":"'"
which will put single quotation marks around "hello 1234" thus holding it together.
Hope this helps
Stephan
in fact I also sometimes feel the need to quote things, e.g. an email subject that contains blanks or an enumeration.
It's usually helpful to first decide on which quotation mark to use on inner and outer quotation (" or '). If you want to use parameter evaluation should choose " as inner quotation mark.
I would try your example like this:
"testing.sh ":"'":"hello 1234":"'"
which will put single quotation marks around "hello 1234" thus holding it together.
Hope this helps
Stephan