| ▲ | xp84 4 hours ago | |
If shipping something that must run on sh, check your life choices and use [ - otherwise [[ is better. Honestly though I’ve been much happier since I stopped writing anything complex enough to have conditionals in Shell. Using a real scripting language like Ruby, Python, even PHP or Perl if you know them, is better. In the Ruby case I just use `%x( … )` when I need to run shell commands (there are some things shell does great like passing pipelines of text through 5 programs) and let the logic part be in Ruby. | ||