Last active
August 29, 2015 14:04
-
-
Save dacarlin/a047d0845eafe3c3366a to your computer and use it in GitHub Desktop.
Gets the number of jobs Terry's running on Epiphany
This file contains 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
# part of the "You can bash that" series ... | |
qstat -u \* | awk '{print $4}' | tail -n +3 | uniq --count | awk '/teo/ {print $1}' | |
# and a (slightly) shorter way using only AWK (probably faster) | |
qstat -u \* | awk 'BEGIN {i = 0}; $NR > 3 && $4 ~ /teo/ {i++}; END {print i}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment