``` command: ["/bin/sh"] args: ["-c", "while true; do echo hello; sleep 10;done . . .

Alok Mishra:

command: ["/bin/sh"]
args: ["-c", "while true; do echo hello; sleep 10;done"]

Hello guys, Can anyone help me to understand, what is the significance of using -c in args field?

Paweł Cyrklaf:
Bash provides extensive debugging features. The most common is to start up the subshell with the -x option, which will run the entire script in debug mode. Traces of each command plus its arguments are printed to standard output after the commands have been expanded but before they are executed.

Alok Mishra:
and what about -c option. why this is useful

Luis Hernandez:
with -c you can execute commands that are passed as a string

bash -c 'echo hello world'

Shivam Srivastava:
https://linuxconcept.com/solution/what-is-the-sh-c-command/#:~:text=The%20sh%20-c%20command%20is,be%20executed%20by%20the%20shell|https://linuxconcept.com/solution/what-is-the-sh-c-command/#:~:text=The%20sh%20-c%20command%20is,be%20executed%20by%20the%20shell.

Alok Mishra:
Thank you @Luis Hernandez and @Shivam Srivastava. Very helpful