Guest User

Untitled

a guest
Feb 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #!/bin/bash
  2. tty=$(cat /sys/class/tty/tty0/active)
  3. active_user=$(w | grep $tty | awk '{print $1;}')
  4.  
  5. #to get the display also:
  6. disp=$(who | awk -v term="$tty" '/(:/ $0 ~ term { gsub(/(|)/, "", $0); print $5 }')
Add Comment
Please, Sign In to add comment