Closed mpanighetti closed 4 years ago
If it's all the same, I'd rather switch to:
CURRENT_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/&&!/loginwindow/{print $3}')
for the reasons outlined here: https://scriptingosx.com/2020/02/getting-the-current-user-in-macos-update/
Sounds like the main reason to use the SystemConfiguration method is if the system has root enabled. Definitely an edge case but I have no issue using it since it produces mostly the same results. Will update.
Thanks!
CURRENT_USER
definition not call Python (removes Python dependency to future-proof against Python runtime's eventual removal from macOS as per macOS Catalina 10.15 Release Notes) #31