My fraternity is preparing for its big 175-year celebrations, and we have published the festival program, which includes our festival bank account number. Of course this number needed to be validated. A lot. Because you do not want to publish this thing with an incorrect bank account number.
Since the number is an IBAN, or International Bank Account Number, it actually includes a two-digit checksum that can be used to validate it. There are a lot of websites out there, probably including your own bank, that offer to validate IBANs. But I don't like having to visit a website everytime I want to check an account number, giving the website's owner access to that number and using the Internet for some easy mathematical calculations that my computer can do completely on its own.
Wikipedia actually lists the procedure required to validate an IBAN. (I used the German-language Wiki article, though.) Short answer is: Bite off the two-letter country ID and the checksum; replace each letter in the country ID with its position in the alphabet plus nine; then put together the actual account number + the numerical value of the country ID + the checksum, and see if that mod 97 is one. If it is, the IBAN is valid. If it isn't, well... duh.
So after reading up on doing some basic string manipulation in Bash, I came up with this little script that does the job for you. No internet connection required. Just give it your IBAN as argument one and it will print out a nice little colored message.
Just click "View on GitHub" down there to see the script file.