Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.
In "Pitfall: validate an IPv4 address" awk returns not-zero when the input is a valid IPv4 address and zero otherwise. That's because awk's boolean arithmetic assigns 1 to True and 0 to False.
This is not what a shell programmer would expect because shells usually act in the opposite way: true=0 and false=1.
Thus, the final "shell-compatible" script should be:
In "Pitfall: validate an IPv4 address" awk returns not-zero when the input is a valid IPv4 address and zero otherwise. That's because awk's boolean arithmetic assigns 1 to True and 0 to False.
This is not what a shell programmer would expect because shells usually act in the opposite way: true=0 and false=1.
Thus, the final "shell-compatible" script should be:
However, I'd prefer to use something simpler:
Reply To This Comment