How can I print the output to the terminal and the file at the same time?
$ perl foo.pl > foout.txt
doesn't let me see a living process.
Is there a way to see the output process in real time and get the screen output to a file at the end?
perl foo.pl | tee foout.txt
perl foo.pl |
tee
foout.txt
The tee utility will do this.
. IO::Tee. ( , File::Tee, , - ).
. Log4perl , .
, , , , tee, .
perl ( , Unix tee)
perl foo.pl | perl myPipe.pl myFile.txt
myFile.txt
myPipe.pl
# open OUTFILE,">$ARGV[0]" or die "Unable to open file: $ARGV[0]\n"; while(<>) { print; print OUTFILE; } close OUTFILE;
STDIN , . ,
Source: https://habr.com/ru/post/1713576/More articles:Внедрение сравнения с использованием общего интерфейса в С++ - c++Signing an assembly with Nant - .netHow to get FPS games (with OpenGL) like 800 FPS - openglAnimation from one style to another - triggersShorter GUID using CRC - guidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1713577/visual-studio-2008-warning-about-changes-to-designer-generated-code&usg=ALkJrhjHY0S2YovIlDFzDl59_ctxlGylIwEasy HTML Parser to convert to rich text? - c ++How to properly configure netbeans 6.7 and c ++ on windows? - c ++Загрузка текстовых файлов с помощью Python и ftplib.FTP из z/os - pythonLinux terminal issue with noncanonical terminal I / O application - linuxAll Articles