I'm re-phrasing the question because it was highly confusing and was badly phrased... )-:I have a docker container and I'm reading logs from it like this:docker exec -it my-container sh -c export TERM=xterm && ls -t /logs/my-log.* | xargs zless -Rnow, I want to use 'grep' on the output and I am facing a problem because this one is working:docker exec -it my-container sh -c export TERM=xterm && ls -t /logs/my-log.* | xargs zless -R | grep sometextwhile this one is not working:docker exec -it my-container sh -c export TERM=xterm && ls -t /logs/my-log.* | xargs zless -R | grep sometext(note that the 1st working command includes the grep within the command I send and in the 2nd one I run grep on the output)it is important to me because I am running the command in a script and I want to allow running grep on this script's output.
running grep on a docker exec command's output
shell script;docker