Is it possible to call redis-cli
in bash?
I tried:
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "Text read from file: $line"
echo 'keys $line' | redis-cli | sed 's/^/get /' | redis-cli
done < "$1"
It returns:
line 4: redis-cli: command not found
I am trying to match the redis key nt:<numbers>
as key from input file and display.
Sample input:
nt:60136667431
The command I run:
./updateT.sh input.txt
Is there any way I can call redis-cli get cmd
in script for many key values passed as input?