1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-01 23:17:56 +01:00
tldr/pages/common/if.md
2016-01-13 12:04:46 +01:00

225 B

if

Simple shell conditional.

  • Echo a different thing depending on a command's success:

{{command}} && echo "success" || echo "failure"

  • Full if syntax:

if {{condition}}; then echo "true"; else echo "false"; fi