1. There should be a space between -1 and $read.
2. "if" statements go before commands not after them.
3. Even though it works without them I think using parentheses is a good idea as it makes the structure of the script easier to read. I'd also avoid the use of pipes. You should be able to put each command on it's own line in a popup, just as you would ina remote script.