How to redirect output to a file as well as display it out

December 6th, 2007 mysurface

To redirect standard output to a file is easy, you just need to use the redirection symbol, for example: echo “hello world” > test.txt But what if I want to display it out as well as store into a file? Answer: tee echo “hello world” | tee test.txt Okay it seems very easy, how about [...]

Posted in pipeline, python, tee, Text Manipulation | Hits: 274939 | 37 Comments »

A complete zenity dialog examples 2

April 22nd, 2007 mysurface

This is a continues post of A complete zenity dialog examples 1, in this post we will covers zenity dialog for progress, question, warning, scale, text info and list. How to create zenity progress dialog? Progress dialog is to track a progression of a routine, it can be anything, let say I want store the [...]

Posted in lsof, tee, X11, zenity | Hits: 355833 | 65 Comments »

Redirect output to multiple processes

November 8th, 2006 toydi

Since tee can read the standard input, and write to multiple files, we may leverage this feature so that it writes to multiple processes (instead of files). tee >(process1) >(process2) >(process3) | process4 >( ) (see process substitution) pretends itself as a write-only file. Everything you write into it, will be passed to the command [...]

Posted in Common, grep, process substitution, tee | Hits: 134781 | 34 Comments »

Display & log command output simultaneously

November 6th, 2006 toydi

To display and log the output from a command at the same time: ls -l | tee -a file.log In this example, it will display the directory listing output and as well, save the output into file.log. The option -a signals the command to append rather than overwrite the file. Related Postscompare files and edit [...]

Posted in Common, tee | Hits: 60391 | No Comments »