From 574c69b87ade5e691b42a27f59a100d81d4a31af Mon Sep 17 00:00:00 2001 From: Ebrahim Beiaty Date: Wed, 11 Mar 2026 15:51:45 +0000 Subject: [PATCH 1/3] shell pipelines task --- shell-pipelines/ls-grep/script-01.sh | 1 + shell-pipelines/ls-grep/script-02.sh | 1 + shell-pipelines/ls-grep/script-03.sh | 1 + shell-pipelines/ls-grep/script-04.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-01.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-02.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-03.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-04.sh | 2 ++ shell-pipelines/sort-uniq-head-tail/script-05.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-06.sh | 1 + shell-pipelines/sort-uniq-head-tail/script-07.sh | 1 + shell-pipelines/tr/script-01.sh | 1 + shell-pipelines/tr/script-02.sh | 1 + 13 files changed, 14 insertions(+) diff --git a/shell-pipelines/ls-grep/script-01.sh b/shell-pipelines/ls-grep/script-01.sh index 8c7d968a2..b77993b26 100755 --- a/shell-pipelines/ls-grep/script-01.sh +++ b/shell-pipelines/ls-grep/script-01.sh @@ -4,3 +4,4 @@ set -euo pipefail # 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. # Your output should contain 11 files. +ls sample-files | grep '[A-Z]' diff --git a/shell-pipelines/ls-grep/script-02.sh b/shell-pipelines/ls-grep/script-02.sh index 16f5f71d9..4fa4206cd 100755 --- a/shell-pipelines/ls-grep/script-02.sh +++ b/shell-pipelines/ls-grep/script-02.sh @@ -4,3 +4,4 @@ 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. # Your output should contain 10 files. +ls sample-files | grep '^[A-Z]' diff --git a/shell-pipelines/ls-grep/script-03.sh b/shell-pipelines/ls-grep/script-03.sh index a302ab036..9b79f1c8c 100755 --- a/shell-pipelines/ls-grep/script-03.sh +++ b/shell-pipelines/ls-grep/script-03.sh @@ -4,3 +4,4 @@ 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. # Your output should contain 7 files. +ls sample-files | grep '^[A-Z][^A-Z]*$' diff --git a/shell-pipelines/ls-grep/script-04.sh b/shell-pipelines/ls-grep/script-04.sh index c000b7e3b..b9b1fef9e 100755 --- a/shell-pipelines/ls-grep/script-04.sh +++ b/shell-pipelines/ls-grep/script-04.sh @@ -4,3 +4,4 @@ set -euo pipefail # 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. # Your output should be the number 7. +ls sample-files | grep '^[A-Z][^A-Z]*$' | wc -l diff --git a/shell-pipelines/sort-uniq-head-tail/script-01.sh b/shell-pipelines/sort-uniq-head-tail/script-01.sh index 171e1f989..845ad89da 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-01.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-01.sh @@ -5,3 +5,4 @@ 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 name. # 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". +sort scores-table.txt diff --git a/shell-pipelines/sort-uniq-head-tail/script-02.sh b/shell-pipelines/sort-uniq-head-tail/script-02.sh index 29c3c2524..e0281500d 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-02.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-02.sh @@ -5,3 +5,4 @@ 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. # The first line of your output should be "Basia London 22 9 6" (with no quotes). +sort -k3,3nr scores-table.txt diff --git a/shell-pipelines/sort-uniq-head-tail/script-03.sh b/shell-pipelines/sort-uniq-head-tail/script-03.sh index bcbaf3420..8e3f8b350 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-03.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-03.sh @@ -8,3 +8,4 @@ set -euo pipefail # Basia London 22 9 6 # Piotr Glasgow 15 2 25 11 8 # Chandra Birmingham 12 6 +sort -k3,3nr scores-table.txt | head -3 \ No newline at end of file diff --git a/shell-pipelines/sort-uniq-head-tail/script-04.sh b/shell-pipelines/sort-uniq-head-tail/script-04.sh index 65a5cfba8..fdf8178ee 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-04.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-04.sh @@ -5,3 +5,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 shows the line for the player whose first score was the second highest. # Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes). +sort -k3,3nr scores-table.txt | head -2 | tail -1 + diff --git a/shell-pipelines/sort-uniq-head-tail/script-05.sh b/shell-pipelines/sort-uniq-head-tail/script-05.sh index a93cd9f9d..8eba57e36 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-05.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-05.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to show a list of all events that have happened, without duplication. # The order they're displayed doesn't matter, but we never want to see the same event listed twice. # Your output should contain 6 lines. +sort events.txt | uniq diff --git a/shell-pipelines/sort-uniq-head-tail/script-06.sh b/shell-pipelines/sort-uniq-head-tail/script-06.sh index 715c7ae5c..62a643697 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-06.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-06.sh @@ -5,3 +5,4 @@ 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. # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events. +cut -d' ' -f1 events.txt | sort | uniq -c \ No newline at end of file diff --git a/shell-pipelines/sort-uniq-head-tail/script-07.sh b/shell-pipelines/sort-uniq-head-tail/script-07.sh index 7fd07e1ff..8c637ef20 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-07.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-07.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to show how many times anyone has entered and exited. # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events. # The word "Event" should not appear in your script's output. +awk 'NR>1 {counts[$3]++} END {for (event in counts) print counts[event], event}' events-with-timestamps.txt diff --git a/shell-pipelines/tr/script-01.sh b/shell-pipelines/tr/script-01.sh index 8bb0211e9..3553c5aa5 100755 --- a/shell-pipelines/tr/script-01.sh +++ b/shell-pipelines/tr/script-01.sh @@ -6,3 +6,4 @@ set -euo pipefail # The author got feedback that they're using too many exclamation marks (!). # # TODO: Write a command to output the contents of text.txt with every exclamation mark (!) replaced with a full-stop (.). +tr '!' '.' < text.txt \ No newline at end of file diff --git a/shell-pipelines/tr/script-02.sh b/shell-pipelines/tr/script-02.sh index cf3a503a2..a5250f788 100755 --- a/shell-pipelines/tr/script-02.sh +++ b/shell-pipelines/tr/script-02.sh @@ -7,3 +7,4 @@ set -euo pipefail # so every Y should be a Z, and every Z should be a Y! # # TODO: Write a command to output the contents of text.txt with every Y and Z swapped (both upper and lower case). +tr 'YyZz' 'ZzYy' < text.txt \ No newline at end of file From 856f2fc35850ee6e6450d2aae545e321181af1d4 Mon Sep 17 00:00:00 2001 From: Ebrahim Beiaty Date: Sun, 26 Apr 2026 16:29:52 +0100 Subject: [PATCH 2/3] added new lines. --- .DS_Store | Bin 0 -> 8196 bytes package.json | 15 +++ .../sort-uniq-head-tail/script-03.sh | 2 +- .../sort-uniq-head-tail/script-06.sh | 2 +- shell-pipelines/tr/script-01.sh | 2 +- shell-pipelines/tr/script-02.sh | 2 +- sprint-5/.DS_Store | Bin 0 -> 6148 bytes tests/runIntegrationTests.js | 96 ++++++++++++++++++ 8 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 .DS_Store create mode 100644 package.json create mode 100644 sprint-5/.DS_Store create mode 100644 tests/runIntegrationTests.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3789c891bd2c9e9a8bbadd1901d9eb1b4d4ce9ba GIT binary patch literal 8196 zcmeHMO>f*p7=CB7rQW7Z+;kJtBG8JJ5QipBODP}@Y&WS;_)wy38aDJ}vDcH0i8JHc z-fTmOw0Ahc4?yC|jRR6|h!Yo%aHZnNi64MOpBa1e;iQ5KRiw_WW}eqG@AJ;gGqy+L zB_dYudY6eNiO51$Xb+<}BB^$j52Zp@GXiAb6Gh~cOI=EUCK&~c0!9I&fKk9Ga2yrD zo~@Gggnd74HKkF&DDX@wpxzG^WQDa1`zh*I2MT=z02WcL6KtFVG^dhbEyI3_nu?g| z>49ZbmK`xzN=JJ|xdUq%_ESvh#8Nu3tY?;;P?+u=yoz=wR!h;8MggP1VFlFLeU#cH zN#NAJ|NJhfL({ZL-h3e2ZXjKFs)wtNJpGSOuvDE7uaE-bK(6CV>4-gw$)W8W|N9(& z{78OG>xdQLH-&LY`~r#(Mq)4LB26HYAP?mhvWM>wj^_WDSYPF073fpCcd);Ldgbh& z`3QRJV$Lo`8eyCIO^1HUu`RGeeP5{iV~SosIKJYQfAe>HahTmb58W{E z<78&$H&z%bo_Ox0b|w zms%UarjTD?5=boDTj)%By<2_>>yQwBdn=n5`(-e(-|e%5sg+I*pFT4(YM&iDR~{Q5 zo0uq1JU@B#C) z?%mz1THX%fQ{Jo4;ogln7dqa;+FHz$=01D%W9RJb$0l*Ypj2 zM?cWd^eg>If3s7p%wA!a*qiJ+dyjpG}y`-dUyO4e4(u%9AYke>R70JHyV K-A(aqEASXX1&F%< literal 0 HcmV?d00001 diff --git a/package.json b/package.json new file mode 100644 index 000000000..85bb6cb6c --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "module-tools", + "version": "1.0.0", + "description": "Exercises to practice and solidify your understanding of the Tools module of the Software Development Course.", + "main": "index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "node tests/runIntegrationTests.js" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/shell-pipelines/sort-uniq-head-tail/script-03.sh b/shell-pipelines/sort-uniq-head-tail/script-03.sh index 8e3f8b350..46959e367 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-03.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-03.sh @@ -8,4 +8,4 @@ set -euo pipefail # Basia London 22 9 6 # Piotr Glasgow 15 2 25 11 8 # Chandra Birmingham 12 6 -sort -k3,3nr scores-table.txt | head -3 \ No newline at end of file +sort -k3,3nr scores-table.txt | head -3 diff --git a/shell-pipelines/sort-uniq-head-tail/script-06.sh b/shell-pipelines/sort-uniq-head-tail/script-06.sh index 62a643697..ef4144b65 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-06.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-06.sh @@ -5,4 +5,4 @@ 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. # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events. -cut -d' ' -f1 events.txt | sort | uniq -c \ No newline at end of file +cut -d' ' -f1 events.txt | sort | uniq -c diff --git a/shell-pipelines/tr/script-01.sh b/shell-pipelines/tr/script-01.sh index 3553c5aa5..f91ef30d3 100755 --- a/shell-pipelines/tr/script-01.sh +++ b/shell-pipelines/tr/script-01.sh @@ -6,4 +6,4 @@ set -euo pipefail # The author got feedback that they're using too many exclamation marks (!). # # TODO: Write a command to output the contents of text.txt with every exclamation mark (!) replaced with a full-stop (.). -tr '!' '.' < text.txt \ No newline at end of file +tr '!' '.' < text.txt diff --git a/shell-pipelines/tr/script-02.sh b/shell-pipelines/tr/script-02.sh index a5250f788..96a208b9a 100755 --- a/shell-pipelines/tr/script-02.sh +++ b/shell-pipelines/tr/script-02.sh @@ -7,4 +7,4 @@ set -euo pipefail # so every Y should be a Z, and every Z should be a Y! # # TODO: Write a command to output the contents of text.txt with every Y and Z swapped (both upper and lower case). -tr 'YyZz' 'ZzYy' < text.txt \ No newline at end of file +tr 'YyZz' 'ZzYy' < text.txt diff --git a/sprint-5/.DS_Store b/sprint-5/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Sun, 26 Apr 2026 16:45:16 +0100 Subject: [PATCH 3/3] Remove non-shell-pipelines files from PR scope --- .DS_Store | Bin 8196 -> 0 bytes package.json | 15 ------ sprint-5/.DS_Store | Bin 6148 -> 0 bytes tests/runIntegrationTests.js | 96 ----------------------------------- 4 files changed, 111 deletions(-) delete mode 100644 .DS_Store delete mode 100644 package.json delete mode 100644 sprint-5/.DS_Store delete mode 100644 tests/runIntegrationTests.js diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 3789c891bd2c9e9a8bbadd1901d9eb1b4d4ce9ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMO>f*p7=CB7rQW7Z+;kJtBG8JJ5QipBODP}@Y&WS;_)wy38aDJ}vDcH0i8JHc z-fTmOw0Ahc4?yC|jRR6|h!Yo%aHZnNi64MOpBa1e;iQ5KRiw_WW}eqG@AJ;gGqy+L zB_dYudY6eNiO51$Xb+<}BB^$j52Zp@GXiAb6Gh~cOI=EUCK&~c0!9I&fKk9Ga2yrD zo~@Gggnd74HKkF&DDX@wpxzG^WQDa1`zh*I2MT=z02WcL6KtFVG^dhbEyI3_nu?g| z>49ZbmK`xzN=JJ|xdUq%_ESvh#8Nu3tY?;;P?+u=yoz=wR!h;8MggP1VFlFLeU#cH zN#NAJ|NJhfL({ZL-h3e2ZXjKFs)wtNJpGSOuvDE7uaE-bK(6CV>4-gw$)W8W|N9(& z{78OG>xdQLH-&LY`~r#(Mq)4LB26HYAP?mhvWM>wj^_WDSYPF073fpCcd);Ldgbh& z`3QRJV$Lo`8eyCIO^1HUu`RGeeP5{iV~SosIKJYQfAe>HahTmb58W{E z<78&$H&z%bo_Ox0b|w zms%UarjTD?5=boDTj)%By<2_>>yQwBdn=n5`(-e(-|e%5sg+I*pFT4(YM&iDR~{Q5 zo0uq1JU@B#C) z?%mz1THX%fQ{Jo4;ogln7dqa;+FHz$=01D%W9RJb$0l*Ypj2 zM?cWd^eg>If3s7p%wA!a*qiJ+dyjpG}y`-dUyO4e4(u%9AYke>R70JHyV K-A(aqEASXX1&F%< diff --git a/package.json b/package.json deleted file mode 100644 index 85bb6cb6c..000000000 --- a/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "module-tools", - "version": "1.0.0", - "description": "Exercises to practice and solidify your understanding of the Tools module of the Software Development Course.", - "main": "index.js", - "directories": { - "test": "tests" - }, - "scripts": { - "test": "node tests/runIntegrationTests.js" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/sprint-5/.DS_Store b/sprint-5/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0