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

```
It works for me according to @steeldriver's tips,

* make sure you use `bash`

```
#!/bin/bash

```
* use the bash syntax for arithmetic evaluation

```
((...))

```

Otherwise the shellscript can remain the same,

```
#!/bin/bash

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

    if (( INPUT % 5 == 0 )) ; then
        echo "you entered right"
        break
    else
        echo "you entered wrong"
    fi
done

```

Edit: You have modified the question. This answer corresponds to a previous version of the question. (It is not clear to me, if you want to break the loop, when there is no remainder or when there is a remainder.)