0

I know you can save the output of executing a script/file to another file by using:

./script.sh >> script_output.log

but this doesn't display the output in terminal during execution. Is there any way to also save the contents of execution in a file and display the messages in the terminal, during the script's execution?

Thank you in advance

1
  • 1
    None of those suggested using script. Nov 24, 2015 at 20:19

1 Answer 1

3

What you need is tee:

./script.sh | tee -a script_output.log

The -a parameter appends to the output file, since you used >> in your example.

0

Not the answer you're looking for? Browse other questions tagged .