The user enters the port number that is written to the PORT variable, can you explain how to check the variable for a number, and moreover, that this number be in the range from 0 to 65536

This option does not work - it does not enter the cycle if I write to the PORT a number greater than 65536

while $PORT <= 0 || $PORT >= 65536 

    2 answers 2

    In bash, it is better to use arithmetic calculations:

     while ((PORT<=0 || PORT>=65536)) 

    if posix-compatibility is required, it is better this way:

     while [ "$PORT" -le 0 -o "$PORT" -ge 65536 ] 

      Can this option - while $PORT >= 0 && $PORT <= 65536 ?