News for hackers. Stuff that matters.
Re:Safe ways to do things in bash by koala_man on Monday May 14, 2018 @09:10PM (#17070811)
$(..) is its own context so you just put double quotes around any variables like you normally would:

    parent_dir="$(basename "$dir")"
[ and [[ can indeed be tricky. You may find ShellCheck useful, since it recognizes common problems like [ a=b ], [-e .bashrc], [ 1 > 2 ], [ -n var ], [ false ] and several others.

There are no comments on this comment yet.