3 ms·
You just add quotes around $dir. Bash understands the quotes properly/recursively. parent_dir = "$(basename "$dir")"
by zeroimpl 8y ago
You just add quotes around $dir. Bash understands the quotes properly/recursively.
parent_dir = "$(basename "$dir")"
- codedokode 8y agoSo I finally found the answer. Thanks.
- 8xde0wcNwpslOw 8y agoBear 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.