Skip to content

Grep -o used in solution for the Little Women exercise but never explained #1489

@colinsauze

Description

@colinsauze

What is the problem?

The "Little Women" exercise in the finding things episode uses grep -o but never explains what grep -o does or why it is used here. There isn't any hint in the exercise to lookup this option in the manpage/help either.

Without using -o a slightly different answer comes up because some lines contain a name twice and using -o counts all instances, not using it will count them all as one. A possible workaround could be to ask for the number of lines containing each person, not the number of times their name appears in the text.

Location of problem (optional)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions