code example:
my PWD = /aa/bb/cc/dd
dir= `dirname "$(PWD)"`
output = `basename "${dir}"`
dir variable outputs correctly: /aa/bb/cc
desired output variable: cc
error I'm getting: /bin/sh: 1: Syntax error: Unterminated quoted string
I've tried different quotation combinations and other things like these suggested solutions: https://stackoverflow.com/questions/22401091/bash-variable-substitution-vs-dirname-and-basename/22402242 and https://unix.stackexchange.com/questions/253524/dirname-and-basename-vs-parameter-expansion
user1094771. Please see I accidentally created two accounts; how do I merge them?