Posted on 03-13-2015 03:35 AM
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
Solved! Go to Solution.
Posted on 03-13-2015 05:18 AM
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
Posted on 03-13-2015 05:18 AM
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
Posted on 03-13-2015 05:20 AM
` quote in jamfnation considers as script so i missed it. Thanks
Posted on 03-16-2015 02:28 AM
Lesson learned.
Thanks for that.