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:
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
Thanks
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
chucksteel
9 years ago