The first line of your script reads like:
#!/bin/bash -f
You are passing the -f
switch to bash when the script is invoked. This causes the shell to disable file name expansion, which is also known as globbing or pattern matching. Remove that -f
from the shebang line.
Also, you should note that to select all files in bash you use just "*
", and not "*.*
". The later would select only files with a dot in their names. This may also cause you to try to put the directory into itself, which is an invalid operation.