zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: How to obtain a simple use-case: redirect filtered data into file, unfiltered to the terminal?
Date: Thu, 7 Feb 2019 16:22:42 -0800	[thread overview]
Message-ID: <CAH+w=7aj6zOgijgAQWF1UOS5+joiaiW2Oyd5Q4eKQXaG2mc=6Q@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVBSJcVYT1WJDBx+63eazZdCbcjuUSQxz9Y91paJ=nGyeg@mail.gmail.com>

On Thu, Feb 7, 2019 at 5:12 AM Sebastian Gniazdowski
<sgniazdowski@gmail.com> 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 ...".

      parent reply	other threads:[~2019-02-08  0:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-07 13:12 Sebastian Gniazdowski
2019-02-07 14:27 ` Eric Cook
2019-02-08  0:22 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7aj6zOgijgAQWF1UOS5+joiaiW2Oyd5Q4eKQXaG2mc=6Q@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).