Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. # Capture the names of the keys (sets)
  2. KEYS=$(redis-cli keys 'myset:*')
  3.  
  4. # Paste each line from the key names with the output of `redis-cli scard key`
  5. # and sort on the second key in reverse
  6.  
  7. paste <(echo "$KEYS") <(echo "$KEYS" | sed 's/^/scard /' | redis-cli) | sort -k2 -r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement