A
A
Alexander Vladimirovich2021-01-12 15:14:31
bash
Alexander Vladimirovich, 2021-01-12 15:14:31

How to save the colored output of a command to a file?

Greetings!
It is required to save the output of the yandex-weather-cli command to a file, so that later, when outputting from the file, the output will be colored. Now the plain text is saved. 5ffd929c3fcff021901729.png
result
5ffd945a3b923151568470.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lynn "Coffee Man", 2021-01-12
@polyanin

Can use script

script -qec yandex-weather-cli weather.txt
# или если нужен вывод только в файл
script -qec yandex-weather-cli weather.txt > /dev/null

5ffd97b020b85449740088.png

A
aleks-th, 2021-01-12
@aleks-th

In a text file - None.
A text file can contain only text, but it knows nothing about colors.
---
Well, or convert the output to some html or pdf.
But not in text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question