NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}!"
NAME="John"
echo "Hi $NAME" #=> Hi John
echo 'Hi $NAME' #=> Hi $NAME
echo "I'm in $(pwd)"
echo "I'm in `pwd`"
# Same
git commit && git push
git commit || echo "Commit failed"
get_name() {
echo "John"
}
echo "You are $(get_name)"
See: Functions
if [[ -z "$string" ]]; then
echo "String is empty"
elif [[ -n "$string" ]]; then
echo "String is not empty"
fi
See: Conditionals
set -euo pipefail
IFS=$'\\n\\t'
See: Unofficial bash strict mode