This:
while [[ $red -le 255 && $switch -eq 0 ]] || [[ $red -ge 0 && $switch -eq 1 ]]; do
works perfectly fine under OS X, but I’m having trouble getting it to work in Ubuntu. I feel like it’s something extremely basic that I’m missing, but after Googling around I’m yet to find a solution.
The error is:
[[: not found
The default shell and
/bin/shsubstitute on Ubuntu isdashwhich does not understand[[. Make sure you are running the script inbash.