News for hackers. Stuff that matters.
Re:Safe ways to do things in bash by zeroimpl on Monday May 14, 2018 @08:29PM (#17070644)
You just add quotes around $dir. Bash understands the quotes properly/recursively.

    parent_dir = "$(basename "$dir")"
Re:Safe ways to do things in bash by codedokode on Monday May 14, 2018 @08:53PM (#17070741)
So I finally found the answer. Thanks.
Re:Safe ways to do things in bash by 8xde0wcNwpslOw on Tuesday May 15, 2018 @07:46AM (#17073237)
Bear in mind (pointed by the article as well) that variable assignment doesn't allow spaces around the equals sign, and that in this case the outer parentheses are unnecessary anyway.