I have a script that outputs text to `stdout`. I want to see all this output in my terminal, and at the same time I want to filter some lines and save them in a file. Example:

```
$ myscript
Line A
Line B
Line C

$ myscript | grep -P 'A|C' > out.file

$ cat out.file
Line A
Line C

```

I want to see output of first command in terminal, and save the output of the second command in a file. At the same time. I tried using `tee`, but with no result, or better, with **[reversed result](https://unix.stackexchange.com/questions/36372/pipe-and-log-stdout-at-the-same-time).**