Prova così:

codice:
if [ $comm -eq '1' ];then
   $IP $GW
elif [ $comm -eq '2' ];then
   $IP
elif [ $comm -eq '3' ];then
   $GW
fi
Ciao