Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Execute Redis commands via Bash
#!/usr/bin/env bash
#! This will output info to `users_info.csv`
echo "Getting info from Redis. . ."
redis-cli ping
for i in {1..29885}; do
#! as of 2018, we can use this: EMAIL=$(command) instead
#! Reference:
EMAIL=`redis-cli get "u:$i:mail"`
PLAN=`redis-cli get "u:$i:current_plan"`
echo "$i, $EMAIL, $PLAN"
echo "$i, $EMAIL, $PLAN" >> users_info.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.