Glasgow | 26- SDC-Mar | Taras Mykytiuk | Sprint 2 | Shell pipelines#418
Glasgow | 26- SDC-Mar | Taras Mykytiuk | Sprint 2 | Shell pipelines#418TarasMykytiuk wants to merge 6 commits into
Conversation
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output the names of the files in the sample-files directory whose name starts with an upper case letter. | ||
| ls sample-files | grep '\b[A-Z]' |
There was a problem hiding this comment.
\b won't work for filenames like abc.Xyz because . is considered a word boundary.
Hint: There is a regex symbol that matches "beginning of a string".
There was a problem hiding this comment.
What do you mean by "FixeD"? I don't notice any change made on this file.
There was a problem hiding this comment.
Somehow my changes was reversed before commit
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output the names of the files in the sample-files directory whose name starts with an upper case letter and doesn't contain any other upper case letters. | ||
| ls sample-files | grep -w '[A-Z][a-z]*' |
There was a problem hiding this comment.
-
Filenames are listed one filename per line.
-woption does not help. -
Also, the regex should also work for filenames like
A123.jpg,B$$$.txt.
Note: The same also apply to script-04.sh
There was a problem hiding this comment.
Can the regex detect filenames like A123 or B$$$?
|
Changes are good. |
|
Closing PR because the SDC run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
Shell pipelines exercises are done.