Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


HPR4763: Solving anagrams with bash

Hosted by Ken Fallon on 2026-11-04 00:00:00
Download or Listen

HPR Comments


Whiskeyjack says: Does not work as posted

RE: hpr4763::2026-11-04 Solving anagrams with bash by Ken Fallon
00:07:03 Listen in ogg, opus, or mp3 format.
I'm surprised that I am the first one to comment on this. I tried it and it does not work.

It appears that there are missing backslashes for new line and line continuation instances. I see a total of 9 backslashes missing in "normalise_word". I assume the HPR web site did this.

Also, the supplied anagram must be in quotes or it only sees the first word.

This can be resolved by using $@. However, it appears that you need to capture the name to a variable before passing it to normalise_word.

So -
stationname="${@}"
station="$( normalise_word "${stationname}" )"

Other than the above rather minor points, this was a very interesting episode.

Mastodon Comments



More Information...


Copyright Information

Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

The HPR Website Design is released to the Public Domain.