After reading a ton of documentation and multiple SO solutions, I still cannot get the right syntax for multiple conditions in a while loop with the read line command.
I tried the following stack overflow solution below to no avail.
Bash scripting, multiple conditions in while loop
!/bin/bash
while (( $(read -r line) && "$1" != 1 ))
do
#Do stuff
done < myFile.txt
The error I am getting is ((: && 8 != 1 : syntax error: operand expected (error token is "&& 8 != 1 "
Also tried read -r line
instead of wrapping it in the $
sign and still did not work.
Where did I go wrong?
EDIT: Ignore the logic of my original post. That will eventually get changed. I'm just trying to find out the proper syntax.