Doing 2 points with result from a command

I have a program texcount that outputs the variety of words in my LaTeX record. I can additionally pipeline the result of this to sed to make the newlines TeX linebreaks and also write this to a documents which I can after that include in my last record. Yet when I do texcount foo.tex | sed s/$/'\\\\'/ > wc.tex the command line result of texcount is subdued.

Just how can I get the result of the first command to be presented in the incurable and also piped to sed?

2019-05-13 03:49:46
Source Share
Answers: 3

You can make use of a confidential pipeline for the 2nd command:

texcount foo.tex | tee >(sed s/$/'\\\\'/ > wc.tex)
2019-05-17 15:39:04

You require the "tee" command, which permits you to divide pipelines.

texcount foo.tex | tee >output.txt | sed s/$/'\\\\'/ > wc.tex ; cat output.txt

This would certainly leave you the added output.txt documents. Read this for even more details : You can additionally do "male tee".

2019-05-17 14:39:32

You can make use of the rather colloquial

texcount foo.tex | tee /dev/tty | sed s/$/'\\\\'/ > wc.tex

/dev/tty is a magic tool that describes the managing terminal of the existing procedure.

2019-05-17 10:03:38