Ok. Here is what i got: This time the pop-up is showed when i run the script from terminal but isn't if i use the GUI instead. But the bigger problem is that the numbers showed are wrong. No matter how many times i try, it give me always that same output. I'll turn turn the script back to sh and reboot now.
##Replace bin/sh for bin/bash at the top of the script. ##Like... #!/bin/bash ##Then run from terminal as "bash opt/... "