Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for $user_names to return unique entries only #374

Closed
mreinhardt opened this issue Mar 8, 2017 · 3 comments
Closed

Option for $user_names to return unique entries only #374

mreinhardt opened this issue Mar 8, 2017 · 3 comments
Assignees
Labels
enhancement Issue that suggests an enhancement

Comments

@mreinhardt
Copy link

When a user is logged in to many terminals, the output of $user_names is very noisy. It would be nice to add a ${user_names uniq} option that returns an output similar to:

${execi 60 who | awk '{print $1}' | sort -u | tr '\n' ',' | sed -e 's/,$//' -e 's/,/, /g'}

...which is what I'm currently doing.

@mreinhardt
Copy link
Author

Note: This may be an issue with tmux windows, as I'm logged into a single tty with many pts from tmux windows.

@lasers lasers added the bug Bug report or bug fix PR label Aug 6, 2018
@lasers lasers removed the bug Bug report or bug fix PR label Aug 7, 2018
@lasers
Copy link
Contributor

lasers commented Aug 8, 2018

1 year 5 months passed. Are you still using this command today? Thank you.

@lasers lasers added the enhancement Issue that suggests an enhancement label Aug 13, 2018
@lasers
Copy link
Contributor

lasers commented Sep 3, 2018

It is better to {execi 60} a script instead of implementing this feature request.

I made you a Python command just in case you need a script. Don't put this inside a shell script. ;-)

python -c "from subprocess import check_output;print(', '.join(set([x.split()[0] for x in check_output('who').decode().splitlines()])))"

Thanks for understanding. @su8, we're down to 3 pages now. \o/

@lasers lasers closed this as completed Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue that suggests an enhancement
Projects
None yet
Development

No branches or pull requests

3 participants