/build/static/layout/Breadcrumb_cap_w.png

Script to edit user/Library in Mac OSX

I am trying to run a script to deploy a custom dictionary to Mac OSX. I have the script working offline, but when I try to deploy through K1000 it says it worked but does not make the required changes. I am guessing it fails because the script is not running under the User account that is checking. Is there a way to tell a script to use the logged on user or the default user or the last logged on user or something instead of an admin account? 

For the record, the script I am trying to use is:

NOW=$( date +”%F” )
mkdir -p $TMPDIR/Dict/$NOW
cp $KACE_DEPENDENCY_DIR/Dictionary $TMPDIR/Dict/$NOW/
mv ~/Library/Spelling/LocalDictionary $TMPDIR/Dict/$NOW/LocalDictionary.$NOW
cat $TMPDIR/Dict/$NOW/LocalDictionary.$NOW $TMPDIR/Dict/$NOW/Dictionary | sort -u > $TMPDIR/Dict/$NOW/LocalDictionary
cp $TMPDIR/Dict/$NOW/LocalDictionary ~/Library/Spelling/
killall AppleSpell
So the KACE_DEPENDENCY_DIR and the Library/Spelling folders are both user specific which is where I think this whole thing is falling apart.

Thanks

0 Comments   [ + ] Show comments

Answers (1)

Posted by: chucksteel 9 years ago
Red Belt
0
You could have your script make the changes on all users with something like this:

for i in /Users/**/; do
#your commands here
done


Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
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