mirror of
https://github.com/chubin/cheat.sh.git
synced 2024-11-29 23:36:40 +03:00
added share/scripts
This commit is contained in:
parent
ad0fcd6297
commit
84a9ca3778
20
share/scripts/remove-from-cache.sh
Executable file
20
share/scripts/remove-from-cache.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
remove_by_name()
|
||||
{
|
||||
local query; query="$1"
|
||||
local q
|
||||
|
||||
redis-cli KEYS "$query" | while read -r q; do
|
||||
redis-cli DEL "$q"
|
||||
done
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo Usage:
|
||||
echo
|
||||
echo " $0 QUERY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
remove_by_name "$1"
|
Loading…
Reference in New Issue
Block a user