Last active
August 29, 2015 14:03
-
-
Save chreekat/652d66e1a915b878b819 to your computer and use it in GitHub Desktop.
Set APPDATA (needed for logging in via ssh)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_sid=$(grep "^$USER:" /etc/passwd | sed -e 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*,\(S-1-5-[^:]*\):.*/\1/') | |
_prof=$(cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\ NT/CurrentVersion/ProfileList/${_sid}/ProfileImagePath) | |
export APPDATA="${_prof}\\AppData\\Roaming" | |
unset _sid | |
unset _prof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment