bmMemcached数据更新管理脚本

bmMemcached数据更新管理脚本

cat xxxtyt_memcached_management.sh 
#!/usr/bin/env bash
# Author: royoy
# Date  : July/12 2019
# Desc  : Delete the cache from memcached according to the developer's needs 

memcached_host="10.5.66.41"
memcached_port="11211"

echo ${@} |awk 'gsub(/\\/,"\\\\")1' |sed -E 's@[[:space:]]+(set|get|delete|stats)@\n\1@gi' | while read arg
do
        printf "${arg}\r\n" | nc ${memcached_host} ${memcached_port}
done