/build/static/layout/Breadcrumb_cap_w.png

Issue executing Shell Script to Mac with Variable

I am trying to push a small script to a test mac.  The script will make the current logged in user an admin of the Mac.  The script works when I pass the username over to the Mac.  But as soon as I try to use a variable to get the logged in current user, the script fails.

 

This works (the current username is user2)

dseditgroup -o edit -a user2 -u localadmin -P mm1007mm -t user admin

 

This fails with the following (using $USER to get the current logged in user)

dseditgroup -o edit -a $USER -u localadmin -P mm1007mm -t user admin

 

2014-04-22 10:03:46: Alert not enabled, moving to next phase....

2014-04-22 10:03:52: Sending script script.sh to client....

2014-04-22 10:03:57: Script sent

2014-04-22 10:03:57: Executing script....

2014-04-22 10:04:01: Error 64 received while executing script

 

Any help would be greatly appreciated.


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

 
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