swcarpentry / shell-novice

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

Unix Shell Script, Finding things, Tractknig a species, grep -r #1458

Open jrteuton opened 1 month ago

jrteuton commented 1 month ago

How could the content be improved?

For the class challenge "Tracking a species" the class materials never explicitly introduced the way grep includes "filename :" into its output when parsing a directory with multiple files. The lesson materials have only a single .csv file in the directory. The students all readily understood "cut -d ," for using the comma delimiter; but did not understand why they would want to use "cut -d :" when the data format in the .CSV and as presented in the lesson web page did not contain a ":" As an Instructor I failed to exlpain what grep would do with the -r flag, that it adds the file name and a : which would need to be "cut" away with the cut -d : instruction. Many students tested their solutions on the command line in the animal-counts directory, pointing grep at the single .csv file, and when the "cut -d : " command appeared to add nothing to the process it casused confusion. I suggest the lesson materials get additional .csv files added and or part of the instruction explicitly call out what grep with the -r flag will out put. ... I now have this in my personal notes for the next time I teach the coruse.

Which part of the content does your suggestion apply to?

https://swcarpentry.github.io/shell-novice/instructor/07-find.html

bkmgit commented 1 month ago

Thanks for the observation @jrteuton . Could you make a pull request with an additional file and an improved explanation?