More Bashness

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
Read More...