I am really a Newbie in bash programing and I need to perform a permutation, which I did using one post from this forum as follow Generating permutations using bash.
#!/bin/bash
list=`echo {1..12}`
for c1 in $list
do
for c2 in $list
do
for c3 in $list
do
echo $c1-$c2-$c3
done
done
done
The output is
1-1-1
1-1-2
1-1-3 ...
but I do not want to have a number repeated in the line (1-1-1). Meaning if the number 1 is in the first position, I do not want it neither in the second nor in the third. like this
1-2-3
1-2-4
1-2-5
...
Can anybody help me? any hint is welcome.