I have a basic bash scripting question. The output of this script, I expected to be:
a y b x c y
but instead, I get:
a x b x c x
#!/bin/bash
for foo in 'a' 'b' 'c'; do
echo $foo;
if [ "$foo"=="b" ]; then
echo x;
else
echo y;
fi
done;
What am I missing?