I tried this a few years ago; <a href="http://canonical.org/~kragen/sw/dev3/colors.html" rel="nofollow">http://canonical.org/~kragen/sw/dev3/colors.html</a> has them as foreground colors and <a href="http://canonical.org/~kragen/sw/dev3/colors.2.html" rel="nofollow">http://canonical.org/~kragen/sw/dev3/colors.2.html</a> has them as background colors. I tested 3-letter words as well as 6-letter words, and used 1 as "l" as well as "I", but I didn't try aghasemi's very productive suggestion of using 5 as S. I don't remember if it it didn't occur to me or if I tried it and didn't like the results.<p>Some of them are pretty #bad (#011 doesn't really look much like "oil") and some, though they read quite well, correspond to awful colors; you might even say, #faeca1 colors. Still, I've made my #bed, #0dd as it may be; now I must #11e in it. I think I've #fed you enough #babb1e for today.
The gist is rather a pipeline of Unix commands with no bash necessarily involved. Here it is in shellcheck-compliant 100% bash:<p><pre><code> #!/usr/bin/env bash
shopt -s nocasematch
while read -r word; do
if [[ $word =~ ^[abcdefoi]{6,6}$ ]]; then
word=${word//o/0}
word=${word//i/1}
word=${word^^}
printf '#%s\n' "$word"
fi
done < /usr/share/dict/words
</code></pre>
This could be collapsed to one line with semicolons. On the macOS 12.6 dictionary I get 59 words.<p>Edit: and in sed which someone just asked me for elsewhere:<p><pre><code> sed -n -e '
/^[abcdefoi]\{6,6\}$/I {
s/o/0/g;
s/i/1/g;
s/^/#/;
y/abcdef/ABCDEF/;
p;}' < /usr/share/dict/words</code></pre>
Never mind the colors.<p>This snippet demonstrates how a number of small tools, each doing its narrow job, strung together via the most trivial interface, produces a non-trivial result.<p>This composability is still unreachable to the vast majority of GUI tools.
Does anyone have a link to a guide on how to write Python or node or rust programs that behave well with bash? Ie. Streaming inputs and outputs and other things I probably don’t know about?
Similarly, a list of hex words <a href="https://jott.live/code/hex_words" rel="nofollow">https://jott.live/code/hex_words</a>
Not sure why this is being called "Bash" one-liner. It will work with many shells. It will run noticeably faster in Dash, for example. Test it yourself. Linux chooses Dash for non-interactive use, like this one-line script, because it is faster than Bash.
I don't like using multiple commands.<p><pre><code> mawk 'BEGIN{b = "[abcdefois]"; l = "[a-z]"; W = "^" b l l l l l "$"}; $0 ~ W {print "#" toupper($0);}' /usr/share/dict/words</code></pre>
I wanted a t-shirt that is the color #FAB; and says #FAB; on it, thought it'd be a fun one for digital artists, then I found out how hard it would be to get t-shirt that matches it just right.