1

I am trying to move files inside one folder to another folder. However it just won't work for me. I have several cpp files and subfolders that I want to move. However if I want to move everything with mv * ../somefolder it says cannot stat ´*´.

If I only move a specific file it works, e.g. mv file.cpp ../somefolder but if I try mv *.cpp ../somefolder it gives me the aforementioned error. Why is that?

Some context: I am using ExternalProjet_Add_Step in CMake.

ExternalProject_Add_Step(
    MonoEngine
    copySource
    WORKING_DIRECTORY ${MONOENGINE_DIR}
    DEPENDEES createFolders
    COMMAND mv MonoEngineSource/src/* MonoEngine
    COMMENT "Moving src to MonoEngine folder"
)
  • Remove the * and try with mv MonoEngineSource/src – LnxSlck Mar 11 '15 at 16:21
  • @LnxSlck: If I do that, the src folder will be moved too. – gartenriese Mar 11 '15 at 16:22
2

Make the command:

eval mv MonoEngineSource/src/* MonoEngine

to strip off the implied quoting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.