Shell Scripting tips: http://stackoverflow.com/questions/521226/change-script-directory-to-users-homedir-in-a-shell-script cd $(getent passwd foo | cut -d: -f6)