I believe the reason is that bash is backwards compatible with sh and sh only has [ ], not [[ ]]

Solution: fuck backwards compatibility and use fish

Fish is starting to get more POSIX compliant as of late, the error redirect is no longer ^ /dev/null but 2>/dev/null

Fish might be good for interactivity, but in terms of scripting, just go straight to python. It’s not worth it.

[ is a binary (sometimes a symlink) in /usr/bin. It’s /usr/bin/[ 🤓

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 54 users / day
  • 172 users / week
  • 445 users / month
  • 2.42K users / 6 months
  • 1 subscriber
  • 1.61K Posts
  • 35.6K Comments
  • Modlog