'Gnome-terminal --tab variables don't work

I am trying to open a new terminal tab and have a for loop print the iterator.

gnome-terminal --tab -- /bin/bash -c "for (( num=1;num!=-1;num++ ));do echo $num; sleep 2;done"

After executing the above command for some reason it only prints out the number 3

enter image description here

However, if i run it the command without using gnome-terminal it works as expected. for (( num=1;num!=-1;num++ ));do echo $num; sleep 2;done

enter image description here

Anyone know why?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source