I have to make a permutation in bash with \"eval\" and \"seq\" commands. So I have to make first a permutation that could contain the same numbers, then I have to filter it
If someones curious, heres the solution:
input=3
for i in $(eval echo " {1..$input}{1..$input}{1..$input} "); do
OK=yes
for pos1 in $(seq 0 $((x,1)) ); do
for pos2 in $(seq 0 $((x,1)) ); do
if [ $pos1 != $pos2 ]; then
if [ ${i:$pos1:1} == ${i:$pos2:1} ]; then
OK=no
fi
fi
done
done
if [ $OK = yes ]; then
echo $i
fi
done