syntax error near unexpected token `then'


clear
function test
{
   if[$1 -eq "root"]&&[$2 -eq "123456"]
      then
          echo "Right"
      else
          echo "Wrong"
   fi
}

clear
function test
{
   if [ $1-eq"root" ] && [ $2-eq"123456" ]
      then
          echo "Right"
      else
          echo "Wrong"
   fi
}

相关内容