I have a bash script containing this line:
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
This runs fine on OSX.
However, when I move it move the script on a Docker container running Debian, it fails on the above line with this message:
Bad substitution
Any idea why this happens?