Last active
May 18, 2018 19:16
-
-
Save arodbits/29c77b030e541deddc7db61607f29fa8 to your computer and use it in GitHub Desktop.
Store in a sorted set in Redis all unique values from keys matching a pattern using a shell command
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
redis="redis-cli -h host_name" \ | |
$redis keys "*matching_key_pattern*" | awk -F':' '{print $2}' | awk '!x[$0]++' | xargs -I{} $redis zadd temp-user_ids {} {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment