MacOS Copy Script
Hello Everyone I'm trying to Deploy Office Theme for MacOS
so far was the only way to deploy them is through Script but I'm facing the Following Problem
the Files should be copied to this Folder in the Target Machine I'm trying to use the Username System Variable in this case but i doesn't seem to be resolved
/Users/$USER/Library/Group\ Containers/UBF8T346G9.Office/User\ Content.localized/Templates.localized/
Anyone have an idea how i can run the script where the $USER can be resolved?!
at first: Welcome.
The scripts are running under the system or root user, therefore the $user is not the user you want.
I am not 100% sure if this also works under MacOSX but you can run the script as logged in user or as a special user.
You can also update the script to check for the contents of /users to go through all users to copy the nessesary stuff.
Off the top of my head, you could use File Sync to put the theme resources in a known location (let's say /Library/Temp/theme/). Then, you can use a shell script like this to copy the resources to every "normal" user:
for i in $(dscl . list /Users | grep -v ^_)
cp -R /Library/Temp/theme /Users/$i/Library/Group\ Containers/UBF8T346G9.Office/User\ Content.localized/Templates.localized/