Code review comment for lp:~er-abhinav-upadhyay/ubuntu/natty/tomcat6/bug707405

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

As an alternative one could use this for number detection:

if ! echo $port | grep -Eq '^\-?[0-9]*$' ; then

Advantages:
 * more obvious match of exact *type* of number expected (integers only with optional leading minus)
 * no redirect of errors to /dev/null (in case something else goes wrong not involving the failure you're trying to trigger)

« Back to merge proposal