I am running the following command on ubuntu:
taskset -c 1 ./forLoop
and its giving me the following error:
./forLoop: 1: Syntax error: Bad for loop variable
What is in forLoop is the following:
for (( i = 0 ; i <= 1000000; i++ ))
do
echo "Welcome $i times"
done
simply ./forLoop does execute by itself but I want to attach the process to a certain affinity. Can I ?
This is likely happening because you’re on Ubuntu and the interpreter called
dashgets invoked instead ofbash.Trivially, type this to confirm:
You should see the same “for loop” error.
Some of the ways to fix this problem:
Read more here: https://wiki.ubuntu.com/DashAsBinSh/