News for hackers. Stuff that matters.
Re:Safe ways to do things in bash by rossy on Monday May 14, 2018 @08:31PM (#17070654)
You quote it like this:

    parent_dir="$(basename "$dir")"
Quotes are syntactic in bash, so it understands that the outer pair of quotes are surrounding the command substitution and the inner pair are inside it. This will work regardless of any spaces or special characters in $dir.

There are no comments on this comment yet.