rstacruz / cheatsheets

Cheatsheets for web development - devhints.io
https://devhints.io
13.63k stars 3.58k forks source link

Add examples of one liner if-else conditions #2132

Closed josephpaul0 closed 3 months ago

josephpaul0 commented 3 months ago

As for conditional execution, it is possible to write if/else conditions on a single line.

rstacruz commented 3 months ago

Thanks for this! I hope you don't mind, I think this may not be a good practice to recommend. When using with set -e (which is good practice) this will fail.