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?
↧
How to pipe commands in testcontainers execInContainer metod
↧