Question: So practically for my assignment I need to break out of a true while loop when the user inputs a number that gives a modulus remainder of 0, ex: (25 % 5 = 0 **break loop**) Where in my attempt below have I gone wrong?

```
while true
do
    echo "Please input anything here: "
    read INPUT

    if [ `expr $INPUT % 5` -eq 0 ]; then
        echo "you entered wrong"
    else
        echo "you entered right"
        break
fi
done

```

Answer: 
Move the `break` from the `else` part to the `if` part:

```
#!/bin/bash

while true
do
    echo "Please input anything here: "
    read INPUT

    if [ `expr $INPUT % 5` -eq 0 ]; then
        echo "you entered wrong"
        break
    else
        echo "you entered right"
    fi
done

```
Since this is `bash` script we're talking about, you may want to use `read -p` and arithmetic evaluation `((...))`

```
$ while read -p "Enter number:" input ; do (( input%5 == 0 )) && { echo "Wrong"; break;} || echo "alright"; done
Enter number:11
alright
Enter number:7
alright
Enter number:10
Wrong

```

Portably, you might want to use `[` aka `test`

```
$ [ $((25%5)) -eq 0 ]  && echo "Zero"
Zero
$ [ $((26%5)) -eq 0 ]  && echo "Zero"
$

```