I'm editing an install script to exclude a few directories from being installed, under the base directory, as they're already on the system, and I'll save about a gig doing this. I keep getting mv: target '/tmp/makepkg/unreal-engine/pkg/unreal-engine/opt/unreal-engine/Engine/Binaries' is not a directory I've tried escaping / with \ with no luck. Also tried various other means of using mvmod What's off in my script?

shopt -s extglob # at the very top above all variables in actual script. Not in the function
local mvmod
if [ -n "_system_mono" ];
  mvmod=" " 

mv Engine/Binaries "${mvmod}" "$path_to_Folder/Engine/Binaries"

path_to_folder starts from where Engine is located. If I leave mvmod as just a space character everything moves properly. All of the files are definitely there.

  • when moving multiple files with the mv command the last argument to the mv command must be a directory that you should tell it by the -t switch like mv file1 file2 file3 .... fileN -t /path/to/some/directory; also in -n "_system_mono" you meant -n "$_system_mono"? see also shellcheck.net to verify your script online Commented May 10, 2021 at 12:42
  • Ah, stackoverflow has an answer that makes it seem unnecessary. Need to check shellcheck on my machine. It should be catching those typos. stackoverflow.com/questions/4612157/…
    – ZeroPhase
    Commented May 10, 2021 at 12:49
  • Starting the install over. I tried testing it, while running the packaging command again, and it still gave the same error.
    – ZeroPhase
    Commented May 10, 2021 at 13:02
  • Files are definitely there.
    – ZeroPhase
    Commented May 10, 2021 at 15:02
  • Your (extended) glob never gets expanded since it is quoted - you probably want to declare mvmod as an array and assign either mvmod=( !($thirdparty/Mono|$thirdparty/Python|$thirdparty/Python3) ) or mvmod=() and then expand it in the mv command as "${mvmod[@]}" Commented May 10, 2021 at 15:57


You must log in to answer this question.

Browse other questions tagged .