To create more concise code, you can write if statements in a single line.
Single-line if statement:
$a if echo
|
If…else statements can also be expressed in a single line, though the syntax differs slightly.
Single-line if…else statement:
$a $b echo
|
This technique is referred to as Ternary Operators or Conditional Expressions.