I have a .txt
file that has a list of folders I would like to move from one directory to another. I have seen many posts on this, but none have worked. Mostly because those are using GNU versions of mv
and xargs
. I found this post that is doing what I want but only in Linux. Currently, we are using the latest version of TrueNAS Core which is running FreeBSD version 12.2-RELEASE-p3
I tried using the code below, the folder names in the file have letters, numbers, spaces, (
, and )
:
while IFS= read -r file; do
mv Projects/"$file" Archives/PROJECT\ ARCHIVE\ 2020;
done < Projects/Archive_List_test.txt
It gives me this output:
to Archives/PROJECT ARCHIVE 2020/folder1: No such file or directory
: No such file or directoryE 2020/folder2
folder1 and folder2 are the folder names that are in the list. For my test, I only have 2 folders, but I actually need to move over about 360 folders
Thank you for your time.