In the context where I want to capture the stdout of a process in a file but still want to have this output displayed in the terminal I can choose between
tee. In this context, are these tools essentially equivalent or is there a – possibly subtle – reason to prefer one over the other?
tee are designed for different purposes:
script-- make typescript of terminal session
tee-- pipe fitting
Important differences between
scripttransmits the exit status of the process it supervises, while
tee, being a filter, does not even know about it.
scriptcaptures stdin, stdout, stderr of the process it supervises while
teeonly catches the stream it filters.
None of these differences are relevant in the given context.