I had written a script for moving/Copying files to particular folder. I need to check the filenames and move to respective folders. I can read the filenamess but, checking the filename contains a string giving the error.
Here my script ::
for eachfile in *; do
  echo "INSIDE"
  echo $eachfile
  if [ [ $eachfile =  "CHPOE05"* ] ]; then
    echo  $eachfile
  else
    echo "invalid"
  fi
done
Below is my error:
Uploading file IN PCS FOLDER
INSIDE
CHPOE0500001.txt
INCOK1IGT1.sh: line 44: [: too many arguments
invalid
INSIDE
CHPOE050i1001.txt
INCOK1IGT1.sh: line 44: [: too many arguments