Skip to content

CLI tests use /bin/sh which produces different echo behavior depending on the system #342

@daviddavis

Description

@daviddavis

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working (template-set)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions