I am running below commands in a script
move_jobs() {
  cd $JOB_DIR
    for i in `cat $JOBS_FILE`
      do
        if [ `ls | grep -i ^${i}- | wc -l` -gt 0 ]; then
          cd $i
              if  [ ! -d jobs ]; then
                 mkdir jobs && cd .. && mv "${i}"-* "${i}"/jobs/
              else
                  cd .. && mv "${i}"-* "${i}"/jobs/
              fi
          error_handler $?
         fi
      done
}
but it failing as
mv: cannot stat `folder-*': No such file or directory 
Not sure why move command is failing with regular expression
 
    