From ff506c8e427e71b36759d09a012076cf59369e7e Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 13 Jul 2014 14:39:05 +0200 Subject: [PATCH] Use getent instead of grepping /etc/passwd. Forthcoming versions of cygwin will use a different mechanism for obtaining passwd/group information based on /etc/nsswitch.conf. Thus, it will not be guaranteed that the files /etc/passwd and /etc/group even exist. The recommended way for obtaining those info is by using the getent command, which already works in current versions. --- development/cygwin/lyxprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/cygwin/lyxprofile b/development/cygwin/lyxprofile index f51bd556f1..afa21beb41 100644 --- a/development/cygwin/lyxprofile +++ b/development/cygwin/lyxprofile @@ -1,7 +1,7 @@ # Set up the home directory if not already set in the system environment. if [ -z "${HOME}" ]; then USER=`id -un` - HOME=`grep "^${USER}:" /etc/passwd | cut -d: -f6` + HOME=`getent passwd "${USER}" | cut -d: -f6` if [ -z "${HOME}" -o ! -d "${HOME}" ]; then HOME="/home/${USER}" test -d "${HOME}" || HOME=/tmp -- 2.39.2