I have a program texcount
that outputs the number of words in my LaTeX document. I can also pipe the output of this to sed
to make the newlines TeX linebreaks and write this to a file which I can then include in my final document. But when I do texcount foo.tex | sed s/$/'\\\\'/ > wc.tex
the command line output of texcount
is suppressed.
How can I get the output of the first command to be displayed in the terminal and piped to sed?
tee
. If you're certain shells like Bash, you can pipe tee's output using>(some further commands)
. In other shells, you'd have to give tee a filename argument (this is its standard mode of operation), and then runsome further commands < thatfile
, and then delete the thatfile. Or see Hari's answer below. – dubiousjim Sep 08 '12 at 13:41