Drone

New lines in commands

I would like to create some multiline file in one of the commands

kind: pipeline
name: default

steps:
- name: build
  image: docker
  commands:
    - echo "hello\nworld" > file.txt
    - cat file.txt

but resulting file is not multiline:

build

btw - if I use image: python - it works as expected

any advice ?

echo “hello\nworld” > file.txt

I tried this command on my macbook (not with drone) and I got the same result. In order to get this working I had to use the -e flag.

$ echo "hello\nworld" > file.txt
$ cat file.txt
hello\nworld
$ echo -e 'hello\nworld' > file.txt
$ cat file.txt
hello
world