faster TTY grab

This commit is contained in:
Poil 2012-08-13 22:43:13 +02:00 committed by nojhan
parent 3b6d8c8e68
commit 6f0bf08f61

View File

@ -273,7 +273,7 @@ __user()
__connection()
{
THIS_TTY=tty$(ps aux | awk -v pid=$$ '$0 ~ pid && /bash/{ print $7 }')
THIS_TTY=$(awk -v pid=$$ '$0 ~ pid && /bash/{ print $7 }' < <(ps aux) )
SESS_SRC=$(who | awk -v thistty="$THIS_TTY" '$0 ~ thistty { print $6 }')
# Are we in an SSH connexion?