I was making a script, when I found a problem with sudo command and for loop.
I have this test script
for i in {0..10..2}
do
echo "Welcome $i times"
done
Normal output should be this:
Welcome 0 times
Welcome 2 times
Welcome 4 times
Welcome 6 times
Welcome 8 times
Welcome 10 times
But it shows this:Welcome {0..10..2} times
any ideas ?
bash version:4.3.11(1)-release
The shell in
sudo
does not do brace expansion.Use
seq()
as others have suggested.