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.

Related posts:

  1. Perl Script to Read and Print N Characters from a File
  2. Summary of Unix VI Commands

Comments are closed.