cp $(find "/var/data/steam/steamapps/shadercache" -iname "*dxvk-cache") dxvk
cp: cannot stat '/var/data/steam/steamapps/shadercache/632360/DXVK_state_cache/Risk': No such file or directory
cp: cannot stat 'of': No such file or directory
cp: cannot stat 'Rain': No such file or directory
cp: cannot stat '2.dxvk-cache': No such file or directory
This is because the output of find is actually one long string with line breaks.
The solution
I suggest swapping the commands around. So for every file we find, we copy it.
find "directoryhere" -iname "*dxvk-cache" -exec cp "{}" dxvk \;
The problem
The script fails on files that contains spaces
This is because the output of
find
is actually one long string with line breaks.The solution
I suggest swapping the commands around. So for every file we find, we copy it.
find "directoryhere" -iname "*dxvk-cache" -exec cp "{}" dxvk \;