Tagged Questions
3
votes
2answers
33 views
How to duplicate a stream and process both parts in a streaming way?
Sometimes I want to insert something in a pipeline for reporting or some other secondary use. It might be as simple as wc -l, or a more complex beast like awk or even a python script. It'd be nice to ...
2
votes
3answers
87 views
Output to stdout and at the same time grep into a file
I have a script that outputs text to stdout. I want to see all this output in my terminal, and at the same time I want to filter some lines and save them in a file. Example:
$ myscript
Line A
Line B
...
3
votes
3answers
146 views
tee + cat: use an output several times and then concatenate results
If I call some command, for instance an echo I can use the results from that command in several other commands with tee. Example:
echo "Hello world!" | tee >(command1) >(command2) ...
1
vote
2answers
297 views
Print/Tee to console without passing output to pipe
Is there a way to print or tee one thing to the console and still pass something else through to the next pipe? Something like:
echo dog | printOrWhatnot "PUTTING MY THING DOWN" | sed 's/dog/cat/g' | ...
3
votes
2answers
485 views
How do I use tee to redirect to grep
I don't have much experience of using tee, so I hope this is not very basic.
After viewing one of the answers to this question I came across a strange beheviour with tee.
In order for me to output ...
4
votes
1answer
180 views
command like wc but with tee behaviour
I want to backup a database using psql and COPY command. here is my script:
psql "user=${USERNAME} host=${HOSTNAME} dbname=${DBNAME} password=${PASSWORD}" -c \
"COPY (SELECT * FROM tbl) ORDER BY id ...