This is a really basic question, but I couldn't find it asked this basically in an existing question, so please flag this if it's been answered before.
I want to pipe stderr from a bash command to a file, but not prevent it from being displayed on the terminal during execution.
More specifically, I have this .sh file:
nslookup MadeUpName
nslookup MadeUpName2
nslookup MadeUpName3
and I'm doing this:
. ./myScript.sh 2>errors.txt
This works to pipe error messages to errors.txt, but now I can't see the errors in the terminal as they happen.