How to redirect the Shell Program output to file and Screen in Unix

Tee Unix Command to redirect the shell output to file and Screen

The tee utility will copy standard input to standard output, making a copy in zero or more files.
For more information “man tee”
Sample
#!/bin/sh
test=”welcome to the world of linux”
echo $test | test Sample.txt // Here output will be redirected to Screen and Sample.txt
Enroll your comments if you find it is useful.

About mohan

This is Mohan Jayapalan author of TechPages Blog.I am a part time blogger and Currently working for private Software Concern.

© Copyright 2010-2016 www.techpages.org · All Rights Reserved · Powered by WordPress ·