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 can both print the result on the screen and also write into a file.
Thanks in advance.
I have a shell script that greps some data.. I want to print the
Share
Pipe your output to the
teecommand.Example:
Note that the stdout of
echois printed out as well as written to the file specified by thrteecommand.