I'm trying to write a Bash script for macOS to create a directory in a user's documents folder. I do this:
dmg_dir="~/Documents/My dir"
# Create a directory
$(mkdir -p "$dmg_dir")
But it fails as the interpreter seems not to unfold the tilde in the path.
What am I doing wrong?