When I run this script on my terminal it works perfectly with the newline
echo -e $(echo "a \na")
Outputs:
a
a
When I wrap this up in a bash script - test.sh:
#!/bin/sh
echo -e $(echo "a \na")
And I call ./test.sh, I get this output:
-e a a
How can I make the bash script give the same output with the newline as running directly on the terminal?