0

I am trying to redirect the stdout of a particular output to a txt file, however I would still like to view it in the console log

tail -f /var/log/kern.log | ./prsfwlog -f elfs/prs_log.elf | \
grep -E --line-buffered "RSSI|SNR" | sed -n -e 's/^.*RTS\/Grant //p'

this is the line that gets me the desired output I have tried a variety of redirects and tees and have not been successful

4
  • 2
    How are you using tee ?
    – PierU
    Commented Oct 7, 2022 at 16:23
  • 2
    Using tee is the logical answer. Perhaps you could show us what you did that didn't work.
    – harrymc
    Commented Oct 7, 2022 at 16:23
  • as mentioned, tee is the proper answer but you can indeed use tail but you will need to tail the command from either a different terminal or turn that one loose with & and tail from there.. Commented Oct 7, 2022 at 18:02
  • tee >( grep -E "RSSI|SNR" ) RSSI_SNR_LOGS.txt I added this to the end of my code with a |
    – Nir
    Commented Oct 7, 2022 at 18:22

1 Answer 1

0

Try

tail -f /var/log/kern.log | ./prsfwlog -f elfs/prs_log.elf | \
grep -E --line-buffered "RSSI|SNR" | sed -n -e 's/^.*RTS\/Grant //p' | tee myfile.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .