Loop through lines in file and send to redis-cli

bash, redis

Solution

I don't see any problem here:

 redis-cli KEYS 'session.*' | awk '{printf "EXPIRE %s 60\n", $1}' | redis-cli > expire.log

Problem

I have a file created through the use of `$ redis-cli KEYS session.* > keys.txt`, which currently has about 950,000 lines/keys in it. I want to loop through all of these and set an expire on them, and would prefer to avoid writing even a python script for it.

Original source