Closed yongchanghao closed 4 years ago
Bash on macOS can't process with "-3", but is ok to with"21".
Here is how I solved it on Mac:
# OUTPUT="${FILENAME::-3}" --> ERROR on MacOS: substring expression < 0 OUTPUT="${FILENAME::$((${#FILENAME} - 3))}" # same outcome, but working syntax
Bash on macOS can't process with "-3", but is ok to with"21".