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

Ep 4. Tip "Redirecting to the same file" -- to prevent following along mistake #1375

Open
emcaulay opened this issue Mar 6, 2023 · 5 comments
Assignees
Labels
type:clarification Suggest change to make lesson clearer

Comments

@emcaulay
Copy link
Contributor

emcaulay commented Mar 6, 2023

https://swcarpentry.github.io/shell-novice/04-pipefilter/index.html#redirecting-to-the-same-file

I am writing this issue to make it easier to discuss.

Why should a revision be considered?
Pedagogy -- the flow of the Carpentries lessons is to provide "follow along" examples. However, in this section of the lesson (tip: redirecting to the same file) gives a demonstration of what not to do, and if the learner follows along then they are hampered from continuing the lesson.

A possible revision
The community member who initially raised this concern suggested adding a step of making a new copy of the file before executing the bad example code. e.g.,

We will make a copy of lengths.txt to use as an example:
BASH
$ cp lengths.txt lencopy.txt
$ sort -n lencopy.txt > lencopy.txt
Doing something like this may give you incorrect results and/or delete the contents of the file. You'll find lencopy.txt is no longer a copy, and is likely blank now.

NB: This issue is a re-working of a previous issue to provide more actionable information. (Revised from #1372)

Background
The original feedback came from a Carpentries community member through the Carpentries Core team, so there is no ability to discuss further with the originator of this idea. I happened to notice the title of the issue and was intrigued to read through the issue. Once I read the comment, I could see the value of the feedback, but realized some work needed to be done to figure out what episode of the lesson the commenter was referring to. Once I did that work, I thought it would be clearer and easier to start a new issue.

@bkmgit
Copy link
Contributor

bkmgit commented Mar 7, 2023

Am in favor of this, see https://github.com/swcarpentry/shell-novice/pull/1363/files though there is a callout with the information #1363 Maybe it is better to emphasize that one can lose data, though some participants may want a deeper explanation of why.

@emcaulay
Copy link
Contributor Author

emcaulay commented Mar 9, 2023

I am a bit confused (please understand I am still a novice at Git and Github) -- I think the PR linked above is a good solution.

I see the PR is closed, but I do not see the change in the episode. Was the change rejected?

@emcaulay
Copy link
Contributor Author

emcaulay commented Mar 9, 2023

Okay, I made some progress navigating Github, and I see that the PR was rejected. I think the PR could introduce a little protection to support learners and instructors in learning the pitfall while also being able to continue follow along with the commands presented in the episode.

@gcapes
Copy link
Contributor

gcapes commented Mar 10, 2023

There is value in showing this (what not to do), because it differs from variable assignment which some learners might be applying to their mental model of what's going on in the shell. Reassigning to a file is different to a = a + 1.

However, I think a better solution is to remind learners how they generated the lengths.txt file in the first place, so they can recover, if they 'pressed the red button' ("don't press the red button!")

wc -l *.pdb > lengths.txt

This is less cumbersome and more realistic than making a copy of the file in order to make a deliberate mistake.

@gcapes gcapes added the type:clarification Suggest change to make lesson clearer label Mar 10, 2023
@gcapes gcapes changed the title Consider revision to Episode 4, Tip "Redirecting to the same file" -- to prevent following along mistake Ep 4. Tip "Redirecting to the same file" -- to prevent following along mistake Mar 10, 2023
@bkmgit
Copy link
Contributor

bkmgit commented Mar 12, 2023

@emcaulay Does the suggestion seem ok to you? Would you like to make a pull request implementing this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:clarification Suggest change to make lesson clearer
Projects
None yet
Development

No branches or pull requests

3 participants