Julian Wiley

Bash Variables

<!-- Variable -->

WARNING: Unported Hugo shortcode (manual conversion needed): {{< note title="Variable" >}}

NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}

WARNING: Unported Hugo shortcode (manual conversion needed): {{< /note >}}

<!-- Condition -->

WARNING: Unported Hugo shortcode (manual conversion needed): {{< note title="Condition" >}}

if [[ -z "$string" ]]; then
  echo "String is empty"
elif [[ -n "$string" ]]; then
  echo "String is not empty"
fi

WARNING: Unported Hugo shortcode (manual conversion needed): {{< /note >}}