I'm trying to create a utility for extracting the first display that a user is physically at using grep and awk:
$ w | grep -P '^naftuli' | awk '{print $3;}'
:0
reprisal
tmux(2464).%0
tmux(2464).%1
tmux(2464).%2
I have seen variant X session identifiers, is there a standard format that I could implement a regular expression for?