Reputation: 17
I'm trying to build a line-by-line userlist of random characters. Below I will explain what I wanna do.
aaaa
aaab
aaac
aaad
I want a script that can create all posibilities until xxxx (4-digits).
Is there a way that I can do this via a bash script?
My OS is CentOS 7.0
Upvotes: 0
Views: 40
Reputation: 623
You can use
echo {a..z}{a..z}{a..z}{a..z}
You can also use loop for getting the output in the format you desire by using following loop
for i in `echo {a..z}`; do for j in `echo {a..z}`;do for k in `echo {a..z}`; do for l in `echo {a..z}`;do echo $i$j$k$l;done; done ;done; done
The second one is the bad way to do it..
Upvotes: 1