Fedora:
$ /bin/sh
$ echo "test\ntest"
Ubuntu (Github Actions):
$ /bin/sh
$ echo "test\ntest"
test
test
For Fedora, /bin/sh points to bash but on Ubuntu, it points to dash, which I suppose explains the difference. When I use bash on Ubuntu, it works like I'd expect:
$ /bin/bash
$ echo "test\ntest"
test\ntest
Throughout our tests we are calling echo "$OUTPUT" | jq which can cause problems if the json happens to contain \n as these will get converted to linebreaks in dash which are not valid json.
I'm thinking we should change our test scripts to use bash instead of sh?
Fedora:
Ubuntu (Github Actions):
For Fedora,
/bin/shpoints to bash but on Ubuntu, it points to dash, which I suppose explains the difference. When I use bash on Ubuntu, it works like I'd expect:Throughout our tests we are calling
echo "$OUTPUT" | jqwhich can cause problems if the json happens to contain\nas these will get converted to linebreaks in dash which are not valid json.I'm thinking we should change our test scripts to use bash instead of sh?