Ternary Operator

Learn what the ternary operator is and how it works in Bash.

We'll cover the following...

Ternary operator

The ternary operator is also known as the conditional operator and ternary if. It first appeared in the programming language ALGOL. The operator turned out to be convenient and many programmers liked it. The languages of the next generation, BCPL and C, inherited the ...