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:
[ 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.
[ Parent
| on HN ]
There are no comments on this comment yet.