Suppose I created a stream from my "main" stream, which is designed to monitor and print some variables in "main". But "main" also generates some output, so I want to separately output the output of these two streams. How can I redirect the output of a new thread to a new console different from the one used by the "main" thread in my c program?
I would output the monitoring information to a file and then use tail -f filenameto display it in my other terminal.
tail -f filename
, grep what-have-you .
grep
, tail -f log_file.txt , , , , (tty), . , , , , .
tail -f log_file.txt
, - , . - make. script, , cat tail .
cat
tail
#!/bin/sh truncate --size=0 ./logfile.txt xterm "tail -f ./logfile.txt" 2>&1 > /dev/null & your_program --log-file=./logfile.txt
.
, , , , - syslog.
syslog
()?
, . , , ( ), .
- ?
Source: https://habr.com/ru/post/1776280/More articles:Log Exclusion Properties - c #Calculations by end-of-week date in Javascript? - javascriptThe most efficient object-oriented approach to a 4-way temperature converter - c #Is there an (reusable) Android user interface component for an input field that supports autocompletion and suggestions? - androidRails 3 Username-Bound Routing Resources - ruby-on-railsПроблема с часовым поясом по умолчанию Coldfusion 9 - timezoneOpening a terminal from Linux Makefile - c ++Интеграция PythonTidy в Coda? - pythonfind substring inside bash variable - bashHow to speed up this double cycle? - performanceAll Articles