swcarpentry / shell-novice

The Unix Shell
http://swcarpentry.github.io/shell-novice/
Other
373 stars 969 forks source link

updated path in 05-loop.md to be relative to home directory #1414

Closed theabro closed 11 months ago

theabro commented 12 months ago

Currently, in the "Nelle's Pipeline: Processing Files" section of episodes/05-loop.md (line 597), the text reads

Starting from her home directory, Nelle types:

however, the code snippet just below this (line 600) then reads:

cd north-pacific-gyre

This path is incorrect, as if starting from the users home directory this line should read

cd Desktop/shell-lesson-data/north-pacific-gyre
github-actions[bot] commented 12 months ago

Thank you!

Thank you for your pull request :smiley:

:robot: This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

Rendered Changes

:mag: Inspect the changes: https://github.com/swcarpentry/shell-novice/compare/md-outputs..md-outputs-PR-1414

The following changes were observed in the rendered markdown documents:

 05-loop.md | 5 +++--
 md5sum.txt | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
What does this mean? If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

:stopwatch: Updated at 2023-07-23 08:00:48 +0000

bkmgit commented 12 months ago

Thanks for the contribution. The home directory may not be Desktop, so probably something further is needed. Typically in bash one can check the output of echo $HOME to see what this is set to.

theabro commented 12 months ago

In the rest of the lesson, Desktop is explicitly stated as being within the users home directory, e.g. in episodes/02-filedir.md (line 801):

$ cd ~/Desktop/shell-lesson-data

and in episodes/07-find.md (lines 44-45):

$ cd
$ cd Desktop/shell-lesson-data/exercise-data/writing

This is also consistent from episodes/02-filedir.md with the use of a Mac for the examples, where Desktop is inside a users home directory:

In future examples, we’ve used Mac output as the default - Linux and Windows output may differ slightly but should be generally similar.

In any case, the north-pacific-gyre directory is not within the users home directory, as stated from the current text, but is within the shell-lesson-data directory (which the learner has been asked to install in their Desktop), so the descriptive text as it currently stands needs updating in some way if this change to the path is not made.

bkmgit commented 11 months ago

Not sure why, it uses starting from her home directory. The section before that begins " We would like to modify each of the files in shell-lesson-data/exercise-data/creatures," so maybe one could use relative paths

cd ../../north-pacific-gyre

and change the text "starting from her home directory" to "moving to the north-pacific-gyre directory" or something similar.

Alternatively, use

cd
cd Desktop/shell-lesson-data/north-pacific-gyre

Since this will then move to the home directory

bkmgit commented 11 months ago

Can look at other changes for consistent paths in a further change since the home directory maybe different, and changes will be needed through the entire lesson.

theabro commented 11 months ago

In 0b441e9e94b7b027b849a016a4e7e5279a88c828 I have amended the descriptive text to reference the directory moving to, and put in a cd to the home directory prior to the other cd command. Personally I preferred this over a relative path, in case the learner/instructor has somehow moved out of the previous directory. I have also tried to be consistent in how the target directory is formatted.

I agree that consistent paths could be an issue throughout the whole lesson. Currently it seems consistent on a Mac (except for this section), but any system where Desktop is not in the home directory will have problems. There may not be an ideal solution to this.

bkmgit commented 11 months ago

@theabro Thanks. Created another issue to update paths https://github.com/swcarpentry/shell-novice/issues/1419.