4 ms·
$(..) is its own context so you just put double quotes around any variables like you normally would: parent_dir="$(basename "$dir")" [ and [[ can indeed b
by koala_man 8y ago
$(..) 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.