I wanted to take paths to directories from files that we got from a user as parameters of function and from files extract the paths and move all files and folders in the source directory to the destination directory, but something went wrong: It writes to me, that "No such file or directory"
With this input
Where dest_adr.txt contains this path: C:\Users\Michal\Desktop\tmp and source_adr.txt contains this path: C:\Users\Michal\Desktop\test\
#!/bin/bash
FILE_WITH_ADRESS_TO_BLENDER_PATH=$1
FILE_WITH_ADRESS_TO_FOLDER_WITH_ADDONS=$2
function move_folders(){
mv "${PATH_TO_FOLDER_WITH_ADDONS_}"/* "${PATH_TO_BLENDR_DIRECTORIE_}"/
}
if [ $# -eq 0 ]
then
PATH_TO_BLENDR_DIRECTORIE="C:/Program Files/Blender Foundation/Blender 3.0/3.0/scripts/addons"
FOLDER_WITH_ADDONS="none"
echo $PATH_TO_BLENDR_DIRECTORIE
echo $FOLDER_WITH_ADDONS
else
PATH_TO_BLENDR_DIRECTORIE_=$(cat $FILE_WITH_ADRESS_TO_BLENDER_PATH | sed -e 's/\\/\//g' -e 's/\C://g')
PATH_TO_FOLDER_WITH_ADDONS_=$(cat $FILE_WITH_ADRESS_TO_FOLDER_WITH_ADDONS | sed -e 's/\\/\//g' -e 's/\C://g')
echo $PATH_TO_BLENDR_DIRECTORIE_
echo $PATH_TO_FOLDER_WITH_ADDONS_
move_folders
fi
