tldr/pages/common/if.md

12 lines
224 B
Markdown
Raw Normal View History

2016-01-05 18:47:12 +00:00
# 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`