Executing batches of commands using redis cli

后端 未结 4 2030
攒了一身酷
攒了一身酷 2020-12-13 03:10

I have a long text file of redis commands that I need to execute using the redis command line interface:

e.g.

DEL 9012012
DEL 1212
DEL 12214314
         


        
4条回答
  •  暖寄归人
    2020-12-13 04:07

    I know this is an old old thread, but adding this since it seems missed out among other answers, and one that works well for me.

    Using heredoc works well here, if you don't want to use echo or explicitly add \n or create a new file -

    redis-cli <

提交回复
热议问题