More Bashness
14/03/13 11:05
I figured I would share an awesome little bash function that I wrote recently for verifying an IP address. It follows some simple rules:
- The first octet must be greater than 0 and less than 255
- The second octet must be less than 255
- The third octet must be less than 255
- The fourth octet must be greater than 0 and less than 255
- If any octet is “padded” with 0 then it should be corrected