by hallman76 · 3y ago · 0 comments
A few months back I noticed '[' under /bin on my mac. I tried googling to understand what it was, but my google-fu came up short. It felt like one of those ungoogleable things. This link is an excellent starting point for me.
by the name, you'd think you could just use [ 0 -gt 1 <enter>
after all, we don't have to type grep query perg
The invoked binary has no way of aborting script execution. All it can do is barf out on stderr and return an error code, which the shell interprets as false and `if [ "x" = "x"` (without ]) goes into the else branch.
if [[ $0 == "norg" ]]; then
gron --ungron "$@"
And so on