I really dislike working with Bash. I never get familiar with the syntax and there are a lot of idiosyncrasies and hard-to-read params. I tend to prefer using the
subprocess module in Python. That said, sometimes it is incovenient to not use Bash. Assumes Bash v 3.2.
Bash can be very strict with the syntax (especially around new lines, spaces and quotes) which lead to frustrating syntax errors. I’ll add notes when syntax is important.
See shellcheck for this purpose.
$on the LHS!
thencannot be on the same line as
To flip the check, use
[ <cond1> ] && [ <cond2> ]