Redis CLI and Shell Script

Example to print keys and values in shell script :

#!/bin/bash
redis-cli --scan > all.keys
while read -r key
do
  value=$(redis-cli get "$key")
  echo $key '|' $value
done < all.keys

Directly get all the values from keys using redis cli

Leave a Comment