In addition, you should use
if [[ $lines -gt 10 ]]; then something else something fi
test condition really outdated, and therefore it is the direct successor to [ condition ] , mainly because you have to be very careful with these forms. For example, you must specify any $var that you pass to test or [ ] , and there are other details that get hairy. (tests are processed in all ways, like any other command). See the article for more details.
source share