-
-
Notifications
You must be signed in to change notification settings - Fork 90
Glasgow | 26- SDC-Mar | Taras Mykytiuk | Sprint 2 | Shell pipelines #418
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ | |
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Note: The same also apply to |
||
| # Your output should contain 7 files. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,5 @@ set -euo pipefail | |
|
|
||
| # The input for this script is the scores-table.txt file. | ||
| # TODO: Write a command to output scores-table.txt, with lines sorted by the person's first score, descending. | ||
| sort scores-table.txt -k3 -n -r | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Common practice is to specify options before the filename. |
||
| # The first line of your output should be "Basia London 22 9 6" (with no quotes). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,6 @@ set -euo pipefail | |
|
|
||
| # The input for this script is the events.txt file. | ||
| # TODO: Write a command to show how many times anyone has entered and exited. | ||
| cat events.txt | grep 'Entry' | sort -u | wc -l | sed 's/$/ entries/' | ||
| cat events.txt | grep 'Exit' | sort -u | wc -l | sed 's/$/ exits/' | ||
|
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you use only ONE command to produce an output in the form: ? Hint: Extract the words in the first column first. The same applies also to |
||
| # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\bwon't work for filenames likeabc.Xyzbecause.is considered a word boundary.Hint: There is a regex symbol that matches "beginning of a string".