I have a phrase like this:
The quick brown $UNKNOWN1 jumps over the $UNKNOWN2 dog
And I have a worldlist like this:
me
black
lazy
swan
dog
word
sky
fox
nothing
you
How can I permute the list in bash to have all the permutations like:
The quick brown you jumps over the nothing dog
The quick brown fox jumps over the lazy dog
and so on, all permutations. I tried with some for loops but got stuck because I think i need some loop inside a loop (nested loop). Something like:
for i in `cat wordlist.txt`;
do echo "The quick brown $i jumps over the $UNKNOWN2 dog";
done
EDIT:
I think this is it:
#!/bin/bash
for i in `cat wordlist.txt`
do
for a in `cat wordlist.txt`
do
echo "The quick brown $i jumps over the $a dog"
done
done