1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-01 11:55:30 +02:00
tldr/pages/common/if.md
2016-01-07 17:40:49 +02:00

11 lines
224 B
Markdown

# 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`