Hi Devs,
In CEP sample mode, we basically keep a script that changes the axis2
deployment directory by passing the -Daxis2.repo system property to the
usual wso2server.sh script [1]. However, if the directory name passed into
the above system property contains spaces, the repository path is not taken
correctly.
I tried adding quotes to the system property, to the value of the system
property only and other modifications to resolve this issue from the
wso2cep-samples.sh script, but did not succeed. The issue seems to be
occurring because of the wso2server.sh command has a $* after specifying
the bootstrap class and this variable is not enclosed in quotes [2]. If the
$* after the bootstrap class is enclosed in quotes as below, it will work.
-DworkerNode=false \
org.wso2.carbon.bootstrap.Bootstrap "$*"
status=$?
Is there any adverse effect from enclosing the above variable within
quotes?
It seems usually it is recommend to enclose variables within quotes in
shell scripting [3]. Also, according to [4], "$@" might be a better option
for the above line. If so, can we modify the startup script so that spaces
within quotes or similar special characters are treated correctly?
[1]
https://github.com/wso2/product-cep/blob/master/modules/distribution/scripts/wso2cep-samples.sh#L68
[2]
https://github.com/wso2/carbon4-kernel/blob/master/distribution/kernel/carbon-home/bin/wso2server.sh#L307
[3]
http://unix.stackexchange.com/questions/131766/why-does-my-shell-script-choke-on-whitespace-or-other-special-characters
[4]
http://stackoverflow.com/questions/448407/bash-script-to-receive-and-repass-quoted-parameters
Thanks,
Lasantha
--
*Lasantha Fernando*
Senior Software Engineer - Data Technologies Team
WSO2 Inc. http://wso2.com
email: [email protected]
mobile: (+94) 71 5247551
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev