By way of explanation, your code is trying to compare the numeric value of the variable, not the length. The code from sea uses an in-built function to generate the length as a value to compare against, although I would prefer it without the double-quotes. It might work depending on your OS. Some may be picky and complain that you are comparing a string with a numerical operator (the -gt )