Bash quirks
# Bash syntax is a joke
Don’t use spaces before or after =
when declaring variables
No:
|
|
|
|
No:
|
|
|
|
Yep:
|
|
|
|
Use quotes around a variable for multiline output
No:
|
|
|
|
Yep:
|
|
|
|
# if
if
or if [ ]
or if [[ ]]
or if [[[ ]]]
??? I don’t know!
Don’t use spaces before or after =
when declaring variables
No:
|
|
|
|
No:
|
|
|
|
Yep:
|
|
|
|
Use quotes around a variable for multiline output
No:
|
|
|
|
Yep:
|
|
|
|
if
or if [ ]
or if [[ ]]
or if [[[ ]]]
??? I don’t know!