Skip to main content

Hi.



I tried to fetch the current users UID for a script



echo "checking Users UID"
UID=id -u $loggedInUser
echo "$UID"



The output is: Desktop/user_info.sh: line 44: UID: readonly variable
Further there was the idea to check if this is a UID between 501 and 1000 to display if it's a local or AD/OD account.



It would be nice if anybody has an idea how I could approach that?!



Thanks,
Maik

Hi Maik,



UID is a system reserved variable with information about the user id, Please use some other variable



echo "checking Users UID"
UID1=id -u $loggedInUser
echo "$UID1"



Also quote id -u $loggedInUser to store the output of the command to variable



Thanks & Regards,
Karthikeyan


` quote in jamfnation considers as script so i missed it. Thanks


Lesson learned.
Thanks for that.


Reply