Can I use a for or while loop when I have similar pattern in the aliases that I put in my .bashrc file? For example, I have: alias c0='ssh computer-1-0'alias c1='ssh computer-1-1'alias c2='ssh computer-1-2'alias c3='ssh computer-1-3'alias c4='ssh computer-1-4'But I want to do something like i=0while [ i -le 4 ]doalias c$i=ssh computer-1-$ii=`expr $i + 1`done which doesn't work unfortunately. I get an error message: -bash: [: i: integer expression expected.Is there a way to achieve what I desire?
Aliasing using for or while loop in .bashrc
bash;shell;variable;arithmetic
You were very close:i=0while [ $i -le 4 ]; do  alias c$i=ssh computer-1-$i  i=`expr $i + 1`doneJust add a $ character before i inside the while loop.