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

Better solution to "Wildcard expressions" #615

Open
arlin opened this Issue Sep 13, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@arlin

arlin commented Sep 13, 2017

The exercise is written in a way that assumes that ls *A.txt followed by ls *B.txt is the best answer to searching for the desired files without using the [AB] syntax. The questions are framed based on this solution, e.g., the user is given a hint to consider two expressions.

However, the best solution to forming a query without using is simply ls *A.txt *B.txt, and this does not give different results than ls *[AB].txt, which renders parts 2 and 3 moot.

Rewrite both the prompt and the answers to take into account the best answer. The new hint might be something like "Hint: you may need more than one expression, but you don't need more than one command".

@paulamool

This comment has been minimized.

paulamool commented Oct 25, 2017

This exercise shows that ls *[AB].txt does not throw an error on missing file expressions.
Could add ls *A.txt *B.txt to solution point 1, and add extra information to point 3 to clarify this.

  1. The following example expressions match the same set of files
  $ ls *A.txt
  $ ls *B.txt

or

$ ls *A.txt *B.txt
  1. The output from the two ls commands is separated because there are two commands.
  2. You would get an error message for the commands in point 1 when there are no files ending in A.txt, or there are no files ending in B.txt. While ls *[AB].txt would not produce an error message, unless all possible expressions are missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment