Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A ./ prefix should be allowed on output for the grep -l challenge #166

Open
mikeweilgart opened this issue Dec 5, 2018 · 0 comments
Open

Comments

@mikeweilgart
Copy link

Regarding challenge: https://cmdchallenge.com/#/search_for_files_by_extension

The most obvious answer to this challenge is grep -l 500 *, however, this is a bad practice as it will not handle files named beginning with a hyphen. Please see https://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt for examples of how the naked wildcard * can be exploited in various ways.

The correct, best practice answer to the challenge is either grep -l 500 -- * or grep -lR 500 . or grep -l 500 ./*. The latter two answers produce a list of all the appropriate files, but each is prefixed with ./, so the challenge currently doesn't accept these as solutions.

I think the criteria should be modified to allow ./ as a prefix to all files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant