R.L. Dane :Debian: :OpenBSD: 🍵<p>Should've made this a long time ago:</p><pre><code>function ciglob {
#case-insensitive glob generator
echo "$*" |while read -N1 c; do
case "$c" in
[a-zA-Z]) echo -n "[${c^^}${c,,}]";;
*) echo -n "$c"
esac
done
}
</code></pre><pre><code>~ $ ciglob "Hello, world!"
[Hh][Ee][Ll][Ll][Oo], [Ww][Oo][Rr][Ll][Dd]!
~ $ ls -ld $(ciglob documents)
drwxr-xr-x 52 ~~~ ~~~ 20,480 Apr 10 11:45 Documents
</code></pre><p>(Not the most useful example, but I did have a use case in mind when I wrote it ;)</p><p>P.S. (This is a valid way to close a parenthesis. Fight me ;)</p><p><a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a> <a href="https://polymaths.social/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/posix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> <a href="https://polymaths.social/tags/posixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PosixShell</span></a> <a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a></p>