Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a simple example to show error (stderr) redirection #729

Open
fdiblen opened this issue Mar 6, 2018 · 2 comments
Open

add a simple example to show error (stderr) redirection #729

fdiblen opened this issue Mar 6, 2018 · 2 comments

Comments

@fdiblen
Copy link

@fdiblen fdiblen commented Mar 6, 2018

Output redirection is nicely shown in
https://swcarpentry.github.io/shell-novice/04-pipefilter

Both stdout and stderr terms are explained but the examples are only for stdout. It would be nice to add a simple example to show how errors can be redirected.

For example:

ls missing.dat 2> errors.txt
@colinmorris
Copy link
Contributor

@colinmorris colinmorris commented Mar 26, 2018

I wonder if this would be more appropriate for shell-extras. I'm kind of dubious as to whether many learners would use this regularly in their workflow. (For me, it's the kind of thing I need to do once in a blue moon, and need to google the syntax for every time. I always forget whether it's 2>, or >2, and get it confused with the ampersand syntax.)

I almost wonder whether we should cut the one paragraph we do have on stderr entirely. Afaik, it never comes up in any of the examples or exercises.

If we are going to talk about stderr, I wonder if we could do so using an example that forces the subject. Like, we run a command, and redirect its output to a file, but we still see some stuff printed to the terminal - what the heck?

@bagustris
Copy link
Contributor

@bagustris bagustris commented Mar 29, 2018

I agree to include this (stderr) for shell-extras. However, not only stderr, but also the concept of stdin and stdout should be introduced thereafter learning pipe. A good example that can be adopted is shown here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.