In which cases I should use a specific format of command in a container? This on . . .

Edith Puclla:
In which cases I should use a specific format of command in a container?
This one

command: ["/bin/sh", "-c", "while true; do date; sleep $TIME_FREQ;done > /opt/time/time-check.log"]

or this another one, like a list

 - command:
        - /bin/sh
        - -c
        - echo hello; sleep 30; echo world
        

Tharanath:
both will work

Madhan Kumar:
They are essentially the same … just two different ways of representing an array in yaml …

Edith Puclla:
Thanks @Tharanath @Madhan Kumar :star-struck:

Shwetha Shenoy V:
The second way with an array makes it more readable.

Edith Puclla:
yes @Shwetha Shenoy V I chose the second one too :blush: