Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to obtain a simple use-case: redirect filtered data into file, unfiltered to the terminal?



On Thu, Feb 7, 2019 at 5:12 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> So writing one sentence: a terminal application outputting logs
> filtered-and-redirected into a file, preserving the connection and
> output to the terminal

The minimal syntax of the "script" command is "script outputfile
command" ... so let's use zsh tools to create the outputfile, and
leave managing the tty stuff to "script":

script >(ansifilter >>! scrapy.slog) scrapy crawl 2nd_MyDom "$@"
"${optarray[@]}"

This will say something like
  Script started, output file is /dev/fd/12
which you can get rid of by "script -q ...".



Messages sorted by: Reverse Date, Date, Thread, Author