shell-novice
shell-novice copied to clipboard
Ep7 Tracking a species: exercise too difficult?
http://swcarpentry.github.io/shell-novice/07-find/index.html#tracking-a-species
This exercise doesn't really target the learning objectives of the episode. The main concepts tested in the exercise are pipes and filters, and interpreting the man pages to learn about options -- these are not learning objectives for episode 7. Also there is the requirement to implement script arguments from episode 6.
Given the man pages are required for both grep and cut, this exercise should have much more scaffolding. Perhaps splitting into steps would help to focus on the grep aspect, which is a learning objective for this episode.
The learning objectives for Episode 7 are grep and find. Could you be referring to Episode 4 which is Pipe and Filters?
I think referring to a previous episode can help refresh memory.
I have now edited my comment to improve clarity -- hope that helps.
Agreed that the goal isn't clear, as far as a searching script goes. It's not obvious that we are searching the entire directory tree, and a potential hang up would be with cut -d : -f 2. The colon delimiter is difficult to interpret if you've yet to try a recursive grep.
Maybe clarify
She wants to write a shell script that takes a species as the first command-line argument and a directory as the second argument. The script should return one file called species.txt containing a list of dates and the number of that species seen on each date. For example using the data shown above, rabbit.txt would contain:
with instructions highlighting the goal of the search
She wants to write a shell script that takes a species as the first command-line argument and a directory as the second argument. The script should return one file called species.txt containing a list of dates and the number of that species seen on each date. That is, the script needs to recursively search through the directory for the given species, filter out filenames that contain the species, and then filter the desired columns from the datafile(s), redirecting the output to species.txt. For example using the data shown above, rabbit.txt would contain:
I still find this opaque, though.