Hacker News new | ask | show | jobs
by kludgeon 1928 days ago
just use zsh. `if [[ -f file ]] {run this command} else {run that command}`

no closing `fi`, use multiline or single line, add an arbitrary number of elif statements. this only requires the short option is set in your z shell.

1 comments

and I'd call most of this discussion flow control, not conditionals. Strictly speaking, conditionals are one of the primary benefits of zsh over bash imo.