I want to do some troubleshooting on my bash script. Is there a short and simple command that generates both stdout
and stderr
so that I can use 2>&1
on it? Sorry if this looks trivial, but I just can't think of one at the moment.
Shell – A command that generates both standard error and output
io-redirectionshell-scriptstderrstdout
Best Answer
A simple approach would be to use
ls
to list actual and imaginary files:This assumes that there are visible files in the working directory and that you don't have any files that end in
.blah
11. ...and if you do, we won't judge you.