Skip to content

Instantly share code, notes, and snippets.

@kamituel
Created January 15, 2013 20:34
Show Gist options
  • Save kamituel/4541785 to your computer and use it in GitHub Desktop.
Save kamituel/4541785 to your computer and use it in GitHub Desktop.
Using "xargs echo -n"
#!/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