I want to write a bash script to print all possible lower and upper case permutations of a certain word, e.g. harley:
harley
harleY
harlEy
harLey
...
HARLey
HARLEy
HARLEY
My naive solution is to write a n-th (n is len(word)) nested for-loop for this specific word:
#!/bin/bash
for a in {h,H}; do
for b in {a,A}; do
...
done
done
However, I would have to code the script for a different word again.
Is there a better way to accomplish this?