6 ms·
> arbitrarily-punctuated versions of control structures Ahem: if [ x = 1 ] then echo "x is one" else echo "x is not one" echo "namely, it's $x"
by a1369209993 3y ago
> arbitrarily-punctuated versions of control structures
Ahem:
if [ x = 1 ]
then echo "x is one"
else echo "x is not one"
echo "namely, it's $x"
fi
`if [ ] ; then` should only ever be used in one-liners, where there is not a newline after `then`; I'm not sure how that ended up being taught as a way to write multi-line commands (I'd tenatively blame Pascal, but that's probably unfair).