We're doing workshops for internships where we explain the Bash. One topic is redirection, because it's quite important.
So far we explained
2> independent from each other. Our examples are
echo Hello world echo Hello world > file.txt let x=1/0 let x=1/0 2> file2.txt
For programmers with an understanding of the concepts of
strerr, that's not a problem.
However, for interns, the only effect in both cases is: the output is gone and was redirected into a file.
What I'm looking for is a command that produces both, regular output (
stdout) and error output (
stderr). That way we can use
> to redirect only a part of the output,
2> to redirect the other part or both to get 2 files.
The command should be rather simple and not involve too much preparation. The more preparation, the more likely that they will get something wrong.