1
vote
0answers
16 views

Test execution output of a command before a pipe [duplicate]

I would like to test the execution of a php script that redirect its stdout and stderr to a file with tee. php /path/to/script --param 2>&1 | tee -a /path/to/log if ( test $? -ne 0 ); then ...
1
vote
2answers
46 views

grep a keyword from Mplayer output and send the rest to file

I am using mplayer. I want to send everything to a log file (/tmp/server.log), but I want the Volume output to be written to the terminal. I have seen that there is a way to split the output with tee, ...
9
votes
3answers
598 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 ...
5
votes
3answers
2k 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 ...
5
votes
2answers
598 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 ...
5
votes
1answer
533 views

Is it possible to “fork” STDOUT to two different locations? [duplicate]

Possible Duplicate: Is there a way in bash to redirect output and still have it go to stdout? Let's say I do: ps -ef | grep httpd to see if apache is running or not, but I also want to ...