8
votes
2answers
167 views

Redirecting output depending on grep regex

I am using gradle run to start a REST server. The output of the REST server looks like this: XXX.XXX.XX.XXX - <moreinfo> randomtext randomtext XXX.XXX.XX.XXX - <moreinfo> XXX.XXX.XX.XXX - ...
2
votes
1answer
482 views

bottomless tee?

I was just playing around in the terminal and I did this: printf 'some string\n' | { tee /dev/fd/3 | { : && sed 's/some/string/' } } 3>&0 I was really surprised when ...
9
votes
3answers
441 views

tee stdout to stderr?

I'd like to send stdout from one process to the stdin of another process, but also to the console. Sending stdout to stdout+stderr, for instance. For example, I've got git edit aliased to the ...
1
vote
2answers
498 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' | ...
5
votes
2answers
558 views

Wrapping a shell script with tee

There is a bash script which prints some logs and allows some arguments. The script prints the logs to STDOUT. Let's say the script's name is AAA.sh I'd also like to make the script to print the logs ...
4
votes
2answers
456 views

how to redirect terminal output to multiple log files

I've been trying redirect output to logfiles but should NOT be displayed on terminal, but following command does output both on terminal and in logs. Any ideas are appreciated. (some_cmd | tee -a ...
4
votes
1answer
260 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 ...