Shorter than the other answers:
bash
OPTION=$($BOOL && echo --option)
Is it better? I'm not sure.
As long as it works and you understand it, I don't see a reason to change it.
Shorter than the other answers:
OPTION=$($BOOL && echo --option)
Is it better? I'm not sure.
As long as it works and you understand it, I don't see a reason to change it.
Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.