0

I'm creating a cloud init script which should have following commands:

- [sudo, curl, -ks, 'https://download.docker.com/linux/ubuntu/gpg' | sudo, apt-key, add - ]

However, my Visual Studio Code shows me an red error lines after the pipe. Is is something wrong here? How should syntax be? As far as I know, yaml can use ":" sign, thus I put the hyperlink in the quotes, what about the latter part of command?

14661477
  • 1
  • 1
  • Partially yes, many thanks. What about echo command? – 14661477 Aug 04 '22 at 08:43
  • Pipe is a shell construct, and when you pass a list of strings it is not executed in a shell. You probably want to make the whole command a string, which causes it to execute in a shell. – Brett Holman Aug 04 '22 at 14:24

0 Answers0