Skip to content

Instantly share code, notes, and snippets.

@m-rey
Last active May 6, 2026 11:13
Show Gist options
  • Select an option

  • Save m-rey/cc079826a1b3d33fca174f6559fb01c9 to your computer and use it in GitHub Desktop.

Select an option

Save m-rey/cc079826a1b3d33fca174f6559fb01c9 to your computer and use it in GitHub Desktop.
an intentionally very much cursed "one-liner" that returns the name of the bank of any given German IBAN number, without submitting the IBAN to any online service. It instead downloads the public BLZ list and checks against it offline
echo "DE89 3704 0044 0532 0130 00" | { read iban; tmp=$(mktemp); url=$(curl -fsSL "https://www.bundesbank.de/de/aufgaben/unbarer-zahlungsverkehr/serviceangebot/bankleitzahlen/download-bankleitzahlen-602592" | grep -oP '(?<=href=")[^"]*blz-aktuell-txt-data\.txt' | head -1 | sed 's|^/|https://www.bundesbank.de/|'); curl -fsSL "$url" -o "$tmp" && awk -b -v blz="$(echo "$iban" | tr -d ' ' | cut -c5-12)" 'substr($0,1,8)==blz{print substr($0,10,58); exit}' "$tmp" | xargs; rm -f "$tmp"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment