News for hackers. Stuff that matters.
Re:Elegant Bash Conditionals by rcoveson on Tuesday March 02, 2021 @11:43PM (#26324847)
I think you answered your own question. Those `if` constructs are indeed clunky. In fact I'd venture to say it's really just "C-like language Stockholm syndrome" that makes them feel more "maintainable" or "clear".

The bash "or" syntax reads very clearly. Do X or do Y. Do X or fail like so. It's very English-like and intuitive. And understanding why it works is just a matter of understanding logical operator short circuiting, which you have to understand to work in C-like languages anyway.

Re:Elegant Bash Conditionals by kazinator on Tuesday March 02, 2021 @11:46PM (#26324873)
Problem is you have to fork subshells if here is any sequencing involved. Compare

  if condition ; then
    command1
    command2
  else
    command3
    command4
  fi
versus:

  condition && (command1; command2) || (command3; command4)
GNU Bash has a fix for that: non-forking braces.