I have a shell script that greps some data.. I want to print the result into a file, but doing that prevents the result being displayed on the terminal. Is there a way that
Pipe your output to the tee command.
Example:
[me@home]$ echo hello | tee out.txt hello [me@home]$ cat out.txt hello
Note that the stdout of echo is printed out as well as written to the file specified by thr tee command.
echo
tee