Skip to content

Commit ee52f63

Browse files
committed
fixes made and training endings added
1 parent 4a185bb commit ee52f63

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

shell-pipelines/ls-grep/script-01.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to output the names of the files in the sample-files directory whose name contains at least one upper case letter.
66
# Your output should contain 11 files.
7-
ls sample-files/ | grep '[A-Z]'
7+
ls sample-files/ | grep '[A-Z]'

shell-pipelines/ls-grep/script-02.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ set -euo pipefail
55
# TODO: Write a command to output the names of the files in the sample-files directory whose name starts with an upper case letter.
66
# Your output should contain 10 files.
77
ls sample-files/ | grep '^[A-Z]'
8+

shell-pipelines/ls-grep/script-03.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ set -euo pipefail
55
# 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.
66
# Your output should contain 7 files.
77
ls sample-files/ | grep '^[A-Z][^A-Z]*$'
8+

shell-pipelines/ls-grep/script-04.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to count the number of files in the sample-files directory whose name starts with an upper case letter and doesn't contain any other upper case letters.
66
# Your output should be the number 7.
7-
ls sample-files | grep '^[A-Z][^A-Z]*$' | wc -l
7+
ls sample-files | grep '^[A-Z][^A-Z]*$' | wc -l

shell-pipelines/sort-uniq-head-tail/script-01.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with lines sorted by the person's name.
77
# The first line of your output should be "Ahmed London 1 10 4" (with no quotes). And the third line should be "Chandra Birmingham 12 6".
8-
sort scores-table.txt
8+
sort scores-table.txt

shell-pipelines/sort-uniq-head-tail/script-02.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with lines sorted by the person's first score, descending.
77
# The first line of your output should be "Basia London 22 9 6" (with no quotes).
8-
sort scores-table.txt -k3 -n -r
8+
sort scores-table.txt -k3 -n -r

shell-pipelines/sort-uniq-head-tail/script-03.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ set -euo pipefail
88
# Basia London 22 9 6
99
# Piotr Glasgow 15 2 25 11 8
1010
# Chandra Birmingham 12 6
11-
sort scores-table.txt -k3 -n -r | head -3
11+
sort scores-table.txt -k3 -n -r | head -3

shell-pipelines/sort-uniq-head-tail/script-04.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with shows the line for the player whose first score was the second highest.
77
# Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes).
8-
sort scores-table.txt -k3 -n -r | head -3 | tail -2 | head -1
8+
sort scores-table.txt -k3 -n -r | head -2 | tail -1

shell-pipelines/sort-uniq-head-tail/script-06.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ set -euo pipefail
55
# The input for this script is the events.txt file.
66
# TODO: Write a command to show how many times anyone has entered and exited.
77
# It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
8-
grep -c 'Entry' events.txt | sort
9-
grep -c 'Exit' events.txt | sort
8+
grep -o 'Entry' events.txt | uniq -c
9+
grep -o 'Exit' events.txt | uniq -c

shell-pipelines/sort-uniq-head-tail/script-07.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ set -euo pipefail
66
# TODO: Write a command to show how many times anyone has entered and exited.
77
# It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
88
# The word "Event" should not appear in your script's output.
9-
# echo "Entry: ${grep -c 'Entry' events-with-timestamps.txt}"
10-
# echo "Exit: ${grep -c 'Exit' events-with-timestamps.txt}"
11-
echo "Entry: $(grep -c 'Entry' events-with-timestamps.txt)"
12-
echo "Exit: $(grep -c 'Exit' events-with-timestamps.txt)"
9+
grep -o 'Entry' events-with-timestamps.txt | uniq -c
10+
grep -o 'Exit' events-with-timestamps.txt | uniq -c

0 commit comments

Comments
 (0)