Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: