I am trying to get all possible combinations of a of strings within a certain command, except when the strings are the same. I simplified what I'm trying to do and how I tried to do it as follows:
for i in a b c
do
for p in a b c
do
if [ $i -ne $p ]
then
echo "$i and $p"
fi
done
done
The output I expect is:
a b
a c
b a
b c
c a
c b
But it does not seem to work.. any ideas what's wrong with my nested for loops?
help test