#!/bin/bash
if [ "$#" -lt 1 ]
then
  echo "Usage: $0 [filename] [host] [port]"
  exit 1
fi

filename=${1}
host=${2}
port=${3}
while read line
 do
  echo $line | redis-cli -h $2 -p $3 -c
  sleep 0.005
done < $filename

使用方式

sh import.sh bitfield_commands.txt 127.0.0.1 8888

如果需要输出日志到文本

sh import.sh bitfield_commands.txt 127.0.0.1 8888 > import.log 2>&1
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐