Resolve Bash Binary Operator Expected Error with Visual Studio Code on Mac - VicPhanDevOps/mac GitHub Wiki

• The following solution is for when you receive a binary operator expected error when running a Bash script in the Terminal on your Mac.
image

• Type open -a “Visual Studio Code.app” < Bash script > and press the return key to open the Bash script in Visual Studio Code.
image

• Wrap the variables on each line that threw the error in the Terminal in double quotes like “$< variable >” then press the command and S keys to save.
image

• Return to the terminal, type ./< Bash script > and press the return key to run the script again. You won’t receive any errors this time.
image

⚠️ **GitHub.com Fallback** ⚠️