I have a lot of files in /home/somedir/subdir/ and I\'m trying to move them all up to /home/somedir programmatically.
right now I have this:
subprocess.c
You are using shell globbing *
, and expecting the mv
command to know what it means. You can get the same error from a command shell this way:
$ mv 'somedir/subdir/*' ...
Notice the quotes. The shell usually does glob-matching on *
for you, but commands don't do that on their command lines; not even a shell does. There is a C library function called fnmatch
that does shell-style globbing for you, which every programming language more or less copies. It might even have the same name in Python. Or it might have the word "glob" in it; I don't remember.