links:


if then else

  • Compared to other programming languages, shell uses a slightly different syntax for conditions

Example:

if [condition]; then
	echo 'if will be echoed'
else if [condition]; then
	echo 'else if will be printed'
else
	echo 'else will be echoed'

tags: shell, basics