swcarpentry / shell-novice

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

Add `-n` switch to grep command #1392

Open jsteyn opened 1 year ago

jsteyn commented 1 year ago

Without the -n switch on grep to include line numbers on the result, the cut -d : -f 2 of the script serves no purpose

github-actions[bot] commented 1 year 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-1392

The following changes were observed in the rendered markdown documents:

 07-find.md | 2 +-
 md5sum.txt | 2 +-
 2 files changed, 2 insertions(+), 2 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-05-16 11:17:53 +0000

bkmgit commented 1 year ago

Thanks for the pull request. It does not seem to match the output shown in https://github.com/swcarpentry/shell-novice/blob/main/episodes/07-find.md?plain=1#L321-L324 the -n gives line numbers in which the text string is found. Maybe something else is needed? If so, one would also need to update https://github.com/swcarpentry/shell-novice/blob/main/episodes/07-find.md?plain=1#L350-L352