I'm trying to port the following robocopy command to Linux:
robocopy SrcDir DstDir *.dll *.pdb *.xml /xf Unity*.* nunit*.*
In other words, I want to:
- Include all
dll,pdbandxmlfiles - Unless they start with
Unityornunit
I've read the following two threads, but can't figure the exact syntax:
- Copy all files with a certain extension from all subdirectories
- How to use 'cp' command to exclude a specific directory?
My best guess so far would be:
- Enable
shopt -s extglob - Go to the source directory
cd SrcDir - Use this command:
cp ((*.dll | *.pdb | *.xml) && !(Unity*.* | nunit*.*)) DstDir
But I get syntax errors inside my conditional expression, starting at *.dll.