Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to obtain a simple use-case: redirect filtered data into file, unfiltered to the terminal?
- X-seq: zsh-users 23863
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: How to obtain a simple use-case: redirect filtered data into file, unfiltered to the terminal?
- Date: Thu, 7 Feb 2019 14:12:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=3fHwVTr+99cMOFWhdIMXrGKalU58OE5KLFiP9mG+T94=; b=D2IIWtcTKZggj1mRjOk3lM83ZNt/iurdYFQ0b8valQKPA9NUk9VjexB/aWh8tESIoV o32OZBJl6Ax5C3GDm/uybBi/cb5alVC0jTJvXwYXChB9B5xVDN9rfC92tRuxrYmbZvHa 2Y/4mS1XY9G7A9ORugNDDlD2X0UjPaYxeU+fpFqFQfxkpbtLZ18RrXK4+sS7O6NOyHLG VNhe8uJ6Z2opODAh9upGH4IIVgaVP+iy0YEl7HgX+bHS2rT5ZEcSI5ACsL2idTh++pV+ nm40ABzfGcLFqDfhVnBhW4Zc5MQqao01ZXe2lAahzpx6lMyDW4Iu5fuOfFvgkxUaT2k/ ON6Q==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
I have a simple use-case that I would want to implement:
1. There is an application that outputs colorized logs.
2. I want the logs to go into a file (say `operation.log') filtered,
i.e. without colors.
3. But at the same time still go to the terminal unfiltered.
4. I want the application to have a positive response from the
iatty(1) function, i.e. that the application is thinking that the
output is to the terminal (well, it really *is*, it's just that it.
*also* goes to the file).
So writing one sentence: a terminal application outputting logs
filtered-and-redirected into a file, preserving the connection and
output to the terminal, i.e. isatty(1) answers positively for the app.
I tried with multios:
scrapy crawl 2nd_MyDom "$@" "${optarray[@]}" \
> >(ansifilter >>! "scrapy.slog") 1> >/dev/tty
But this solution doesn't realize the 4th item – it doesn't provide
isatty(1) positive response for the app.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author