前端之家收集整理的这篇文章主要介绍了
shell脚本中常用的技能,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
threadCount=`cat count`;
topic=`cat topic`
for redis in $(cat redis.list); do
echo $redis
host=`echo $redis | awk -F ":" '{print $1}'`
port=`echo $redis | awk -F ":" '{print $2}'`
for (( index=0; index<$threadCount; index++ )); do
queueName=hehe-haha-$topic-2.2.2.223-$index
queueName2=hehe-haha-$topic-2.2.2.223-$index
result=`redis-cli -h $host -p $port zcard $queueName`
if [ "$result" != "0" ]; then
echo "redis: $redis queue: $queueName length is $result "
zrangeResult=`redis-cli -h $host -p $port zrange $queueName 0 -1 withscores`
echo $zrangeResult
fi
done
done