Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- tty=$(cat /sys/class/tty/tty0/active)
- active_user=$(w | grep $tty | awk '{print $1;}')
- #to get the display also:
- disp=$(who | awk -v term="$tty" '/(:/ $0 ~ term { gsub(/(|)/, "", $0); print $5 }')
Add Comment
Please, Sign In to add comment