3

Ternary conditional clause

 $ [ test_statement ] && ( then_statement ) || ( else_statement );

— by dhsrocha on Jan. 22, 2018, 5:27 p.m.

Explanation

The test_statement is under a child process (a.k.a. subshell), which will return a boolean output. The then_statement depends on the former to be executed. Otherwise, it will be done upon the latter.