rickchengx commented on PR #13930:
URL:
https://github.com/apache/dolphinscheduler/pull/13930#issuecomment-1512460097
> > The actual command is `perl -Mbignum=bpi -wle "print bpi(2000)"`, if we
don't remove quotes, the command will be `perl -Mbignum=bpi -wle '"print
bpi(2000)"'` and cause error: `Useless use of a constant ("print bpi(2000)") in
void context at -e line 1.`
>
> Technically, the executed command is `"perl" "-Mbignum=bpi" "-wle" "print
bpi(2000)"`, args and command can all be seen as a string, like `ls -l`, it's
same with `"ls" "-l"`. So what we have to do is to remove quotes which is used
to wrap a single String.
>
> For the case echo `ls`, command to be executed is echo '`ls`', and will
print `ls`, however, if the command is echo "`date`", we can get the right
output. It may be an inner bug of kubernetes or i don't get the right usage...,
anyway, user can use `/bin/bash -c to handle this scenario.
If the command executed in the pod is `perl -Mbignum=bpi -wle print
bpi(2000)`, that would be a problem.
For example, the user command is `echo '$SHELL'`, which the expected output
is `$SHELL`
But if the quotes are removed and the command becomes `echo $SHELL`, the
output would be sth like `/bin/bash`, which is not the expected result
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]