From 28d5c57ffe638b3e03bf2cc2fa7c1bd1b161c62a Mon Sep 17 00:00:00 2001 From: rpe <> Date: Sat, 10 Sep 2016 09:44:49 +0000 Subject: [PATCH] Simplify setting the USER and UID variables. While here, convert `` to $(). OK halex --- src/etc/ksh.kshrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/etc/ksh.kshrc b/src/etc/ksh.kshrc index 1ace6dc3..2d04c1df 100644 --- a/src/etc/ksh.kshrc +++ b/src/etc/ksh.kshrc @@ -1,5 +1,5 @@ : -# $OpenBSD: ksh.kshrc,v 1.24 2016/09/10 08:42:06 rpe Exp $ +# $OpenBSD: ksh.kshrc,v 1.25 2016/09/10 09:44:49 rpe Exp $ # # NAME: # ksh.kshrc - global initialization for ksh @@ -33,9 +33,8 @@ case "$-" in *i*) # we are interactive # we may have su'ed so reset these - USER=`whoami 2>/dev/null` - USER=${USER:-`id | sed 's/^[^(]*(\([^)]*\)).*/\1/'`} - UID=`id -u` + USER=$(id -un) + UID=$(id -u) case $UID in 0) PS1S='# ';; esac