I am trying to find an absolute path of a supplied relative path, and use a default one if one was not supplied
Originally I had OUTPUT_PATH=${OUTP:-"/home/default/output/dir"}
I can do
OUTPUT_PATH="$( cd "$(dirname ${OUTP})" && pwd)"
to get the absolute path
but if I combine the two to:
OUTPUT_PATH=${"$( cd "$(dirname ${OUTP})" && pwd)":-"/home/default/output/dir"}
I am getting a bad substitution error, why is that?