/build/static/layout/Breadcrumb_cap_w.png

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?!


0 Comments   [ + ] Show comments

Answers (2)

Posted by: Nico_K 2 years ago
Red Belt
1

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. 

Posted by: JasonEgg 2 years ago
Red Belt
1

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 ^_)

do

cp -R /Library/Temp/theme /Users/$i/Library/Group\ Containers/UBF8T346G9.Office/User\ Content.localized/Templates.localized/

done

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ