Zahit Usta:
I have a question about command
and arg
There are different ways to solve questions related to commands
I tried couple different variations for a question in the mock exam and saw some worked but some did not. Can anybody suggest a way to understand the difference among the ways below in the attached picture?
Trung Tran:
I think they are all the same in term of outcome, it doesn’t work in some cases just because the automation validator can cover all different implementations.
unnivkn:
H @Zahit Usta please go through this: https://kodekloud.slack.com/archives/CDR4R9Z7E/p1639604455134900
Anderson Leite:
the last one has a error (a extra ] at the end of the line"
Mauro Sardara:
The 4th one does not work because "4800"
is part of the arguments of /bin/sh
command, and the command executed after -c
will be just "sleep"
. "sleep 4800"
should be all contained in the string after -c, so ["bin/sh", "-c", "sleep 4800"]
will work.
The last one does not work because it will try to find the command "sleep 4800"
, which does not exist. It should be ["sleep", "4800"]
, so that it will find the command sleep and pass 4800 to it as first argument.