Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

How to pipe commands in testcontainers execInContainer metod

$
0
0

I would like to run piped commands on docker through testcontainer execInContainer method. I'm able to run a single command (e.g. execInContainer("redis-cli", "keys", "*"), but when providing a pipe (e.g. execInContainer("redis-cli", "keys", "*", "|", "grep", "-v", "test")) it reads it as it belongs to the previous command (ERR wrong number of arguments for 'keys' command). What I want to achieve is to remove all keys from redis, beside one. The full script is as follow redis-cli keys * | grep -v test | xargs redis-cli DEL. Any idea how could I do this?


Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>