Fixing the shell script to properly check for array equivalence