What works: any of these three:
ping 8.8.8.8 | grep 3 // this will steadily output any ping with the number 3 somewhere in the line to the terminal
ping 8.8.8.8 > fileping //this will silently add all the ping output to the file 'fileping'
tee filetee < <(ping 8.8.8.8) // this will show the pings in terminal AND add them to the file
What does not work: these two combinations of the above:
ping 8.8.8.8 | grep 3 > fileping // this will run, but silent, and the file stays empty
tee filetee < <(grep 3 < <(ping 8.8.8.8)) // will also run silent, leave empty file
What it is supposed to do: Take the output of ping 8.8.8.8, grep it, and then add the results to a file
Following the recommendation in comment of steeldriver i tried
ping 8.8.8.8 | grep --line-buffered 3 | tee fileping // this will run, output the filtered pings to terminal, and fill the file.
ping 8.8.8.8 | grep --line-buffered 3 > fileping // this will run, silently, and fill the file.
So the actual task works. Yay! Will delve into --line-buffered to find out why
this is mostly for understanding the underlying principles, so an answer explaining why it does not work is probably just as good as a command that uses different principles than '|' and '<'