Script to move all files in a dir into a certain dir

Hello all,

I'm very new to shell scripting and need quite urgently to do this thing for my student job. I have a directory called "vectors" with a bunch of files all named "[something].vector". also i have for each of those files a directory with the name [something]. I now want to move each of those *.vector files into its appropriate folder.
that's what i have produced so far and which is probably totally wrong:

It would be great if you guys helped me!!
thanks! jonathan

FILES="vectors/*\.vector"
for f in $FILES
do
echo "Processing $f"
DIR=$(sed 's/\..*//' "$f")
mv $f $DIR
done

Try this:

#!/bin/bash
cmd=$(ls *.vector)
for f in $cmd
do
        directory=$(echo $f|awk -F . '{print $1}')
        mv $f $directory
done

I assumed that the directory where you want to put the .vector files and these files are in the same directory

Bye

Try:

FILES=vectors/*.vector
for f in $FILES
do
  echo "Processing $f"
  mv "$f" "${f%.*}"
done