In PHP, I can assign a variable like this:
$a = ($b == $c) ? $x : $y; Which assigns to $a the value $x iff $b == $c, and $y otherwise. Is there a way to do this natively in bash?
I am aware that it is possible using a conventional if statement, or using a subshell with echo, but I was hoping there might be a simple way to do it. Writing a 6-line if statement or using a subshell seems like a lot for such a basic operation.