Live Chat!

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

* * * * * 1 votos

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 append?
Related PostsRedirect stderr to stdoutVery [...]

Posted in Text Manipulation, pipeline, python, tee | Hits: 28418 | 1 Comment »

A complete zenity dialog examples 2

* * * * ½ 12 votos

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 results list [...]

Posted in X11, lsof, tee, zenity | Hits: 40416 | 9 Comments »

Redirect output to multiple processes

          0 votos

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 (as standard [...]

Posted in Common, grep, process substitution, tee | Hits: 18166 | 26 Comments »

Display & log command output simultaneously

* * * * * 1 votos

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 simultaneously with [...]

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