|
From: Yuri K. <yur...@gm...> - 2014-06-26 11:18:17
|
>
> Let your script generate the .cmd file when it runs:
>
> echo "myprog \"arg 1\" arg2"> test.cmd
> cmd /c test.cmd # will execute myprog "arg 1" arg2
> rm test.cmd
>
That was one of the things I was talking earlier. But I wanted to use
mktemp for the purpose.
For now I'm using the following solution:
qNGINX_PATH=$(echo "$NGINX_PATH" | sed 's/"/\\"/g; s/\//\\/g')
qNGINX_CONF_PATH=$(echo "$NGINX_CONF_PATH" | sed 's/"/\\"/g; s/\//\\/g')
echo "hstart /elevate \"cmd /k \"\"$qNGINX_PATH\" ${NGINX_CONF_PATH:+-c
\"$qNGINX_CONF_PATH\"} -s reload\"\"" | cmd
I escape double quote symbols there, and convert slashes in paths, if user
were to specify linux style paths. Not a 100% solution. If somebody have
any suggestions I'm all ears.
Regards,
Yuri
|