Created
January 15, 2013 20:34
-
-
Save kamituel/4541785 to your computer and use it in GitHub Desktop.
Using "xargs echo -n"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERS=($(ps axu | cut -f 1 -d \ | tail -n +2 | sort | uniq | xargs echo -n)) | |
echo ${#USERS[@]} users: ${USERS[@]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment