expr is picky about its syntax, it wants spaces between everything; in particular, on both sides of parentheses, operators, variables, and, well, everything else. You also need to quote or backslash-escape the parentheses, otherwise you will get a warning from the shell. (Actually that's the warning you are getting at the mo.)