From 35ff91dc01126d7c3d1da9e9f486421c9ee383eb Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 11:54:48 +0000 Subject: [PATCH 01/20] attempt actions test --- .github/workflows/test-sdc-tasks.yml | 68 ++++++++++++++ .gitignore | 1 + .../individual-shell-tools/awk/script-01.sh | 6 ++ .../individual-shell-tools/awk/script-02.sh | 12 +++ .../individual-shell-tools/awk/script-03.sh | 6 ++ .../individual-shell-tools/awk/script-04.sh | 3 + .../individual-shell-tools/awk/script-05.sh | 6 ++ .../awk/script-06-stretch.sh | 1 + .../individual-shell-tools/awk/script-06.sh | 0 .../awk/script-07-stretch.sh | 6 ++ .../individual-shell-tools/cat/script-01.sh | 1 + .../individual-shell-tools/cat/script-02.sh | 5 + .../individual-shell-tools/cat/script-03.sh | 3 + .../cat/script-04-stretch.sh | 5 + .../individual-shell-tools/grep/script-01.sh | 6 ++ .../individual-shell-tools/grep/script-02.sh | 9 ++ .../individual-shell-tools/grep/script-03.sh | 1 + .../individual-shell-tools/grep/script-04.sh | 10 ++ .../individual-shell-tools/grep/script-05.sh | 5 + .../individual-shell-tools/grep/script-06.sh | 2 + .../individual-shell-tools/grep/script-07.sh | 3 + expect/individual-shell-tools/ls/script-01.sh | 5 + expect/individual-shell-tools/ls/script-02.sh | 3 + expect/individual-shell-tools/ls/script-03.sh | 11 +++ expect/individual-shell-tools/ls/script-04.sh | 8 ++ .../individual-shell-tools/sed/script-01.sh | 11 +++ .../individual-shell-tools/sed/script-02.sh | 11 +++ .../individual-shell-tools/sed/script-03.sh | 6 ++ .../individual-shell-tools/sed/script-04.sh | 11 +++ .../individual-shell-tools/sed/script-05.sh | 11 +++ .../individual-shell-tools/sed/script-06.sh | 11 +++ expect/individual-shell-tools/wc/script-01.sh | 1 + expect/individual-shell-tools/wc/script-02.sh | 1 + expect/individual-shell-tools/wc/script-03.sh | 4 + expect/jq/script-01.sh | 1 + expect/jq/script-02.sh | 1 + expect/jq/script-03.sh | 2 + expect/jq/script-04.sh | 6 ++ expect/jq/script-05.sh | 6 ++ expect/jq/script-06.sh | 6 ++ expect/jq/script-07.sh | 6 ++ expect/jq/script-08.sh | 6 ++ expect/jq/script-09.sh | 6 ++ expect/jq/script-10.sh | 1 + expect/jq/script-11.sh | 1 + expect/shell-pipelines/ls-grep/script-01.sh | 11 +++ expect/shell-pipelines/ls-grep/script-02.sh | 10 ++ expect/shell-pipelines/ls-grep/script-03.sh | 7 ++ expect/shell-pipelines/ls-grep/script-04.sh | 1 + .../sort-uniq-head-tail/script-01.sh | 6 ++ .../sort-uniq-head-tail/script-02.sh | 6 ++ .../sort-uniq-head-tail/script-03.sh | 3 + .../sort-uniq-head-tail/script-04.sh | 1 + .../sort-uniq-head-tail/script-05.sh | 6 ++ .../sort-uniq-head-tail/script-06.sh | 2 + .../sort-uniq-head-tail/script-07.sh | 2 + expect/shell-pipelines/tr/script-01.sh | 11 +++ expect/shell-pipelines/tr/script-02.sh | 11 +++ individual-shell-tools/awk/script-01.sh | 1 + individual-shell-tools/awk/script-02.sh | 3 + individual-shell-tools/awk/script-03.sh | 1 + individual-shell-tools/awk/script-04.sh | 1 + individual-shell-tools/awk/script-05.sh | 1 + .../awk/script-06-stretch.sh | 1 + .../awk/script-07-stretch.sh | 1 + individual-shell-tools/cat/script-01.sh | 1 + individual-shell-tools/cat/script-02.sh | 1 + individual-shell-tools/cat/script-03.sh | 1 + .../cat/script-04-stretch.sh | 1 + individual-shell-tools/grep/script-01.sh | 1 + individual-shell-tools/grep/script-02.sh | 1 + individual-shell-tools/grep/script-03.sh | 1 + individual-shell-tools/grep/script-04.sh | 1 + individual-shell-tools/grep/script-05.sh | 1 + individual-shell-tools/grep/script-06.sh | 1 + individual-shell-tools/grep/script-07.sh | 1 + individual-shell-tools/ls/script-01.sh | 1 + individual-shell-tools/ls/script-02.sh | 1 + individual-shell-tools/ls/script-03.sh | 1 + individual-shell-tools/ls/script-04.sh | 3 +- individual-shell-tools/sed/script-01.sh | 1 + individual-shell-tools/sed/script-02.sh | 1 + individual-shell-tools/sed/script-03.sh | 1 + individual-shell-tools/sed/script-04.sh | 1 + individual-shell-tools/sed/script-05.sh | 1 + individual-shell-tools/sed/script-06.sh | 1 + individual-shell-tools/wc/script-01.sh | 1 + individual-shell-tools/wc/script-02.sh | 1 + individual-shell-tools/wc/script-03.sh | 1 + jq/script-01.sh | 1 + jq/script-02.sh | 1 + jq/script-03.sh | 3 + jq/script-04.sh | 1 + jq/script-05.sh | 1 + jq/script-06.sh | 1 + jq/script-07.sh | 1 + jq/script-08.sh | 1 + jq/script-09.sh | 1 + jq/script-10.sh | 1 + jq/script-11.sh | 1 + 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 + .../sort-uniq-head-tail/script-01.sh | 1 + .../sort-uniq-head-tail/script-02.sh | 1 + .../sort-uniq-head-tail/script-03.sh | 1 + .../sort-uniq-head-tail/script-04.sh | 1 + .../sort-uniq-head-tail/script-05.sh | 1 + .../sort-uniq-head-tail/script-06.sh | 1 + .../sort-uniq-head-tail/script-07.sh | 1 + shell-pipelines/tr/script-01.sh | 1 + shell-pipelines/tr/script-02.sh | 1 + test-sdc.sh | 94 +++++++++++++++++++ 114 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-sdc-tasks.yml create mode 100755 expect/individual-shell-tools/awk/script-01.sh create mode 100755 expect/individual-shell-tools/awk/script-02.sh create mode 100755 expect/individual-shell-tools/awk/script-03.sh create mode 100755 expect/individual-shell-tools/awk/script-04.sh create mode 100755 expect/individual-shell-tools/awk/script-05.sh create mode 100755 expect/individual-shell-tools/awk/script-06-stretch.sh create mode 100644 expect/individual-shell-tools/awk/script-06.sh create mode 100755 expect/individual-shell-tools/awk/script-07-stretch.sh create mode 100755 expect/individual-shell-tools/cat/script-01.sh create mode 100755 expect/individual-shell-tools/cat/script-02.sh create mode 100755 expect/individual-shell-tools/cat/script-03.sh create mode 100755 expect/individual-shell-tools/cat/script-04-stretch.sh create mode 100755 expect/individual-shell-tools/grep/script-01.sh create mode 100755 expect/individual-shell-tools/grep/script-02.sh create mode 100755 expect/individual-shell-tools/grep/script-03.sh create mode 100755 expect/individual-shell-tools/grep/script-04.sh create mode 100755 expect/individual-shell-tools/grep/script-05.sh create mode 100755 expect/individual-shell-tools/grep/script-06.sh create mode 100755 expect/individual-shell-tools/grep/script-07.sh create mode 100755 expect/individual-shell-tools/ls/script-01.sh create mode 100755 expect/individual-shell-tools/ls/script-02.sh create mode 100755 expect/individual-shell-tools/ls/script-03.sh create mode 100755 expect/individual-shell-tools/ls/script-04.sh create mode 100755 expect/individual-shell-tools/sed/script-01.sh create mode 100755 expect/individual-shell-tools/sed/script-02.sh create mode 100755 expect/individual-shell-tools/sed/script-03.sh create mode 100755 expect/individual-shell-tools/sed/script-04.sh create mode 100755 expect/individual-shell-tools/sed/script-05.sh create mode 100755 expect/individual-shell-tools/sed/script-06.sh create mode 100755 expect/individual-shell-tools/wc/script-01.sh create mode 100755 expect/individual-shell-tools/wc/script-02.sh create mode 100755 expect/individual-shell-tools/wc/script-03.sh create mode 100755 expect/jq/script-01.sh create mode 100755 expect/jq/script-02.sh create mode 100755 expect/jq/script-03.sh create mode 100755 expect/jq/script-04.sh create mode 100755 expect/jq/script-05.sh create mode 100755 expect/jq/script-06.sh create mode 100755 expect/jq/script-07.sh create mode 100755 expect/jq/script-08.sh create mode 100755 expect/jq/script-09.sh create mode 100755 expect/jq/script-10.sh create mode 100755 expect/jq/script-11.sh create mode 100755 expect/shell-pipelines/ls-grep/script-01.sh create mode 100755 expect/shell-pipelines/ls-grep/script-02.sh create mode 100755 expect/shell-pipelines/ls-grep/script-03.sh create mode 100755 expect/shell-pipelines/ls-grep/script-04.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-01.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-02.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-03.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-04.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-05.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-06.sh create mode 100755 expect/shell-pipelines/sort-uniq-head-tail/script-07.sh create mode 100755 expect/shell-pipelines/tr/script-01.sh create mode 100755 expect/shell-pipelines/tr/script-02.sh create mode 100755 test-sdc.sh diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml new file mode 100644 index 00000000..08fe2aa1 --- /dev/null +++ b/.github/workflows/test-sdc-tasks.yml @@ -0,0 +1,68 @@ +name: Test SDC Tasks + +on: pull_request + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' + pull_request_target: + types: + - labeled + - unlabeled + - opened + - edited + - reopened + +jobs: + test_sdc_tasks: + + name: Test SDC Tasks + runs-on: ubuntu-slim + permissions: + pull-requests: read + + steps: + - name: checkout pushed PR + uses: actions/checkout@v5 + # with: + # fetch-depth: 2 + - name: checkout expected output + uses: actions/checkout@v5 + with: + ref: origin/expected-solutions + path: expect + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v47.0.5 + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + - name: test individual shell tools + if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') + run: ./test-sdc.sh individual-shell-tools + shell: bash + - name: test jq + if: contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') + run: ./test-sdc.sh jq + shell: bash + - name: test shell-pipelines + if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh') + run: ./test-sdc.sh shell-pipelines + shell: bash + - name: read test output + id: read-test-output + run: | + # Read output.txt and write to GITHUB_OUTPUT + echo 'testoutput<> $GITHUB_OUTPUT + cat testoutput.txt >> $GITHUB_OUTPUT + echo EOF + - name: make output comment + uses: peter-evans/create-or-update-comment@v5.0.0 + with: + issue-number: ${{ github.event.number }} + body: ${{ steps.read-test-output.outputs.testoutput }} + diff --git a/.gitignore b/.gitignore index 3c3629e6..c4234ab7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +testoutput.txt diff --git a/expect/individual-shell-tools/awk/script-01.sh b/expect/individual-shell-tools/awk/script-01.sh new file mode 100755 index 00000000..050f0437 --- /dev/null +++ b/expect/individual-shell-tools/awk/script-01.sh @@ -0,0 +1,6 @@ +Ahmed +Basia +Mehmet +Leila +Piotr +Chandra diff --git a/expect/individual-shell-tools/awk/script-02.sh b/expect/individual-shell-tools/awk/script-02.sh new file mode 100755 index 00000000..44e2e83e --- /dev/null +++ b/expect/individual-shell-tools/awk/script-02.sh @@ -0,0 +1,12 @@ +Ahmed London +Basia London +Mehmet Birmingham +Leila London +Piotr Glasgow +Chandra Birmingham +Ahmed London +Basia London +Mehmet Birmingham +Leila London +Piotr Glasgow +Chandra Birmingham diff --git a/expect/individual-shell-tools/awk/script-03.sh b/expect/individual-shell-tools/awk/script-03.sh new file mode 100755 index 00000000..f5d0b1f0 --- /dev/null +++ b/expect/individual-shell-tools/awk/script-03.sh @@ -0,0 +1,6 @@ +Ahmed 1 +Basia 22 +Mehmet 3 +Leila 1 +Piotr 15 +Chandra 12 diff --git a/expect/individual-shell-tools/awk/script-04.sh b/expect/individual-shell-tools/awk/script-04.sh new file mode 100755 index 00000000..6e95a2f5 --- /dev/null +++ b/expect/individual-shell-tools/awk/script-04.sh @@ -0,0 +1,3 @@ +Ahmed 4 +Basia 6 +Leila 1 diff --git a/expect/individual-shell-tools/awk/script-05.sh b/expect/individual-shell-tools/awk/script-05.sh new file mode 100755 index 00000000..dd7e1d36 --- /dev/null +++ b/expect/individual-shell-tools/awk/script-05.sh @@ -0,0 +1,6 @@ +Ahmed 3 +Basia 3 +Mehmet 3 +Leila 1 +Piotr 5 +Chandra 2 diff --git a/expect/individual-shell-tools/awk/script-06-stretch.sh b/expect/individual-shell-tools/awk/script-06-stretch.sh new file mode 100755 index 00000000..fb1e7bc8 --- /dev/null +++ b/expect/individual-shell-tools/awk/script-06-stretch.sh @@ -0,0 +1 @@ +54 diff --git a/expect/individual-shell-tools/awk/script-06.sh b/expect/individual-shell-tools/awk/script-06.sh new file mode 100644 index 00000000..e69de29b diff --git a/expect/individual-shell-tools/awk/script-07-stretch.sh b/expect/individual-shell-tools/awk/script-07-stretch.sh new file mode 100755 index 00000000..33ff777a --- /dev/null +++ b/expect/individual-shell-tools/awk/script-07-stretch.sh @@ -0,0 +1,6 @@ +Ahmed 15 +Basia 37 +Mehmet 32 +Leila 1 +Piotr 61 +Chandra 18 diff --git a/expect/individual-shell-tools/cat/script-01.sh b/expect/individual-shell-tools/cat/script-01.sh new file mode 100755 index 00000000..ed7bf7d0 --- /dev/null +++ b/expect/individual-shell-tools/cat/script-01.sh @@ -0,0 +1 @@ +Once upon a time... diff --git a/expect/individual-shell-tools/cat/script-02.sh b/expect/individual-shell-tools/cat/script-02.sh new file mode 100755 index 00000000..769b7e08 --- /dev/null +++ b/expect/individual-shell-tools/cat/script-02.sh @@ -0,0 +1,5 @@ +Once upon a time... +There was a house made of gingerbread. +It looked delicious. +I was tempted to take a bite of it. +But this seemed like a bad idea... diff --git a/expect/individual-shell-tools/cat/script-03.sh b/expect/individual-shell-tools/cat/script-03.sh new file mode 100755 index 00000000..f97bd500 --- /dev/null +++ b/expect/individual-shell-tools/cat/script-03.sh @@ -0,0 +1,3 @@ + 1 It looked delicious. + 2 I was tempted to take a bite of it. + 3 But this seemed like a bad idea... diff --git a/expect/individual-shell-tools/cat/script-04-stretch.sh b/expect/individual-shell-tools/cat/script-04-stretch.sh new file mode 100755 index 00000000..6f35e89d --- /dev/null +++ b/expect/individual-shell-tools/cat/script-04-stretch.sh @@ -0,0 +1,5 @@ + 1 Once upon a time... + 2 There was a house made of gingerbread. + 3 It looked delicious. + 4 I was tempted to take a bite of it. + 5 But this seemed like a bad idea... diff --git a/expect/individual-shell-tools/grep/script-01.sh b/expect/individual-shell-tools/grep/script-01.sh new file mode 100755 index 00000000..bc96ffe9 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-01.sh @@ -0,0 +1,6 @@ +Doctor: Hello +Doctor: What's wrong today? +Doctor: That sounds frustrating. When did this start? +Doctor: Say "Hi". +Doctor: You didn't say hello +Doctor: You're welcome, goodbye diff --git a/expect/individual-shell-tools/grep/script-02.sh b/expect/individual-shell-tools/grep/script-02.sh new file mode 100755 index 00000000..bad606e1 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-02.sh @@ -0,0 +1,9 @@ +Doctor: Hello +Patient: Hello Doctor +Doctor: What's wrong today? +Doctor: That sounds frustrating. When did this start? +Doctor: Say "Hi". +Doctor: You didn't say hello +Doctor: You're welcome, goodbye +Patient: I went to the doctor! +Spouse: I'm glad you saw the Doctor: did they cure you? diff --git a/expect/individual-shell-tools/grep/script-03.sh b/expect/individual-shell-tools/grep/script-03.sh new file mode 100755 index 00000000..ec635144 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-03.sh @@ -0,0 +1 @@ +9 diff --git a/expect/individual-shell-tools/grep/script-04.sh b/expect/individual-shell-tools/grep/script-04.sh new file mode 100755 index 00000000..5814afa2 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-04.sh @@ -0,0 +1,10 @@ +Doctor: What's wrong today? +Doctor: That sounds frustrating. When did this start? +Doctor: Say "Hi". +Patient: Hi +Patient: I seem to be cured! +Doctor: You're welcome, goodbye + +Patient: I went to the doctor! +Spouse: I'm glad you saw the Doctor: did they cure you? +Patient: Yes! diff --git a/expect/individual-shell-tools/grep/script-05.sh b/expect/individual-shell-tools/grep/script-05.sh new file mode 100755 index 00000000..2ed07ed2 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-05.sh @@ -0,0 +1,5 @@ +Doctor: You didn't say hello +Patient: I seem to be cured! +-- +Patient: I went to the doctor! +Spouse: I'm glad you saw the Doctor: did they cure you? diff --git a/expect/individual-shell-tools/grep/script-06.sh b/expect/individual-shell-tools/grep/script-06.sh new file mode 100755 index 00000000..87b3a4f5 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-06.sh @@ -0,0 +1,2 @@ +dialogue-2.txt +dialogue.txt diff --git a/expect/individual-shell-tools/grep/script-07.sh b/expect/individual-shell-tools/grep/script-07.sh new file mode 100755 index 00000000..aed78c63 --- /dev/null +++ b/expect/individual-shell-tools/grep/script-07.sh @@ -0,0 +1,3 @@ +dialogue-2.txt:2 +dialogue-3.txt:0 +dialogue.txt:6 diff --git a/expect/individual-shell-tools/ls/script-01.sh b/expect/individual-shell-tools/ls/script-01.sh new file mode 100755 index 00000000..dd590d62 --- /dev/null +++ b/expect/individual-shell-tools/ls/script-01.sh @@ -0,0 +1,5 @@ +child-directory +script-01.sh +script-02.sh +script-03.sh +script-04.sh diff --git a/expect/individual-shell-tools/ls/script-02.sh b/expect/individual-shell-tools/ls/script-02.sh new file mode 100755 index 00000000..bfd087e6 --- /dev/null +++ b/expect/individual-shell-tools/ls/script-02.sh @@ -0,0 +1,3 @@ +helper-1.txt +helper-2.txt +helper-3.txt diff --git a/expect/individual-shell-tools/ls/script-03.sh b/expect/individual-shell-tools/ls/script-03.sh new file mode 100755 index 00000000..36acd715 --- /dev/null +++ b/expect/individual-shell-tools/ls/script-03.sh @@ -0,0 +1,11 @@ +.: +child-directory +script-01.sh +script-02.sh +script-03.sh +script-04.sh + +./child-directory: +helper-1.txt +helper-2.txt +helper-3.txt diff --git a/expect/individual-shell-tools/ls/script-04.sh b/expect/individual-shell-tools/ls/script-04.sh new file mode 100755 index 00000000..86e7570e --- /dev/null +++ b/expect/individual-shell-tools/ls/script-04.sh @@ -0,0 +1,8 @@ +First exercise (sorted newest to oldest): +helper-3.txt +helper-1.txt +helper-2.txt +Second exercise (sorted oldest to newest): +helper-2.txt +helper-1.txt +helper-3.txt diff --git a/expect/individual-shell-tools/sed/script-01.sh b/expect/individual-shell-tools/sed/script-01.sh new file mode 100755 index 00000000..d92b03ab --- /dev/null +++ b/expect/individual-shell-tools/sed/script-01.sh @@ -0,0 +1,11 @@ +ThIs Is a sample fIle for experImentIng wIth sed. + +It contaIns many lInes, and there are some thIngs you may want to do wIth each of them. + +We'll Include some score InformatIon: +37 AlIsha +15 Jacob +7 PIetro +3 Katya + +We also should remember, when we go shoppIng, to get 4 Items: oranges,cheese,bread,olIves. diff --git a/expect/individual-shell-tools/sed/script-02.sh b/expect/individual-shell-tools/sed/script-02.sh new file mode 100755 index 00000000..e326bd4a --- /dev/null +++ b/expect/individual-shell-tools/sed/script-02.sh @@ -0,0 +1,11 @@ +This is a sample file for experimenting with sed. + +It contains many lines, and there are some things you may want to do with each of them. + +We'll include some score information: + Alisha + Jacob + Pietro + Katya + +We also should remember, when we go shopping, to get items: oranges,cheese,bread,olives. diff --git a/expect/individual-shell-tools/sed/script-03.sh b/expect/individual-shell-tools/sed/script-03.sh new file mode 100755 index 00000000..088b17d5 --- /dev/null +++ b/expect/individual-shell-tools/sed/script-03.sh @@ -0,0 +1,6 @@ +This is a sample file for experimenting with sed. + +It contains many lines, and there are some things you may want to do with each of them. + +We'll include some score information: + diff --git a/expect/individual-shell-tools/sed/script-04.sh b/expect/individual-shell-tools/sed/script-04.sh new file mode 100755 index 00000000..852fa155 --- /dev/null +++ b/expect/individual-shell-tools/sed/script-04.sh @@ -0,0 +1,11 @@ +This is a sample file for experimenting with sed. + +It contains many lines, and there are some things you may want to do with each of them. + +We'll include some score information: +37 Alisha +15 Jacob +7 Pietro +3 Katya + +We also should remember, when we go shopping, to get 4 items: oranges,cheese,bread,olives. diff --git a/expect/individual-shell-tools/sed/script-05.sh b/expect/individual-shell-tools/sed/script-05.sh new file mode 100755 index 00000000..fe4d9d10 --- /dev/null +++ b/expect/individual-shell-tools/sed/script-05.sh @@ -0,0 +1,11 @@ +This is a sample file for experimenting with sed. + +It contains many lines, and there are some things you may want to do with each of them. + +We'll include some score information: +Alisha 37 +Jacob 15 +Pietro 7 +Katya 3 + +We also should remember, when we go shopping, to get 4 items: oranges,cheese,bread,olives. diff --git a/expect/individual-shell-tools/sed/script-06.sh b/expect/individual-shell-tools/sed/script-06.sh new file mode 100755 index 00000000..d9f950fe --- /dev/null +++ b/expect/individual-shell-tools/sed/script-06.sh @@ -0,0 +1,11 @@ +This is a sample file for experimenting with sed. + +It contains many lines, and there are some things you may want to do with each of them. + +We'll include some score information: +37 Alisha +15 Jacob +7 Pietro +3 Katya + +We also should remember, when we go shopping, to get 4 items: oranges, cheese, bread, olives. diff --git a/expect/individual-shell-tools/wc/script-01.sh b/expect/individual-shell-tools/wc/script-01.sh new file mode 100755 index 00000000..d1ad53e8 --- /dev/null +++ b/expect/individual-shell-tools/wc/script-01.sh @@ -0,0 +1 @@ +19 ../helper-files/helper-3.txt diff --git a/expect/individual-shell-tools/wc/script-02.sh b/expect/individual-shell-tools/wc/script-02.sh new file mode 100755 index 00000000..6bd060b7 --- /dev/null +++ b/expect/individual-shell-tools/wc/script-02.sh @@ -0,0 +1 @@ +3 ../helper-files/helper-3.txt diff --git a/expect/individual-shell-tools/wc/script-03.sh b/expect/individual-shell-tools/wc/script-03.sh new file mode 100755 index 00000000..572716a4 --- /dev/null +++ b/expect/individual-shell-tools/wc/script-03.sh @@ -0,0 +1,4 @@ + 1 4 20 ../helper-files/helper-1.txt + 1 7 39 ../helper-files/helper-2.txt + 3 19 92 ../helper-files/helper-3.txt + 5 30 151 total diff --git a/expect/jq/script-01.sh b/expect/jq/script-01.sh new file mode 100755 index 00000000..e16f4ed9 --- /dev/null +++ b/expect/jq/script-01.sh @@ -0,0 +1 @@ +Selma diff --git a/expect/jq/script-02.sh b/expect/jq/script-02.sh new file mode 100755 index 00000000..18711aff --- /dev/null +++ b/expect/jq/script-02.sh @@ -0,0 +1 @@ +35 Fashion Street, London, E1 6PX diff --git a/expect/jq/script-03.sh b/expect/jq/script-03.sh new file mode 100755 index 00000000..d63f6ec7 --- /dev/null +++ b/expect/jq/script-03.sh @@ -0,0 +1,2 @@ +Selma, Software Engineer +Selma, Software Engineer diff --git a/expect/jq/script-04.sh b/expect/jq/script-04.sh new file mode 100755 index 00000000..050f0437 --- /dev/null +++ b/expect/jq/script-04.sh @@ -0,0 +1,6 @@ +Ahmed +Basia +Mehmet +Leila +Piotr +Chandra diff --git a/expect/jq/script-05.sh b/expect/jq/script-05.sh new file mode 100755 index 00000000..ee7e0feb --- /dev/null +++ b/expect/jq/script-05.sh @@ -0,0 +1,6 @@ +Ahmed London +Basia London +Mehmet Birmingham +Leila London +Piotr Glasgow +Chandra Birmingham diff --git a/expect/jq/script-06.sh b/expect/jq/script-06.sh new file mode 100755 index 00000000..f5d0b1f0 --- /dev/null +++ b/expect/jq/script-06.sh @@ -0,0 +1,6 @@ +Ahmed 1 +Basia 22 +Mehmet 3 +Leila 1 +Piotr 15 +Chandra 12 diff --git a/expect/jq/script-07.sh b/expect/jq/script-07.sh new file mode 100755 index 00000000..59c783f1 --- /dev/null +++ b/expect/jq/script-07.sh @@ -0,0 +1,6 @@ +Ahmed 4 +Basia 6 +Mehmet 17 +Leila 1 +Piotr 8 +Chandra 6 diff --git a/expect/jq/script-08.sh b/expect/jq/script-08.sh new file mode 100755 index 00000000..dd7e1d36 --- /dev/null +++ b/expect/jq/script-08.sh @@ -0,0 +1,6 @@ +Ahmed 3 +Basia 3 +Mehmet 3 +Leila 1 +Piotr 5 +Chandra 2 diff --git a/expect/jq/script-09.sh b/expect/jq/script-09.sh new file mode 100755 index 00000000..33ff777a --- /dev/null +++ b/expect/jq/script-09.sh @@ -0,0 +1,6 @@ +Ahmed 15 +Basia 37 +Mehmet 32 +Leila 1 +Piotr 61 +Chandra 18 diff --git a/expect/jq/script-10.sh b/expect/jq/script-10.sh new file mode 100755 index 00000000..fb1e7bc8 --- /dev/null +++ b/expect/jq/script-10.sh @@ -0,0 +1 @@ +54 diff --git a/expect/jq/script-11.sh b/expect/jq/script-11.sh new file mode 100755 index 00000000..4e9bdff0 --- /dev/null +++ b/expect/jq/script-11.sh @@ -0,0 +1 @@ +164 diff --git a/expect/shell-pipelines/ls-grep/script-01.sh b/expect/shell-pipelines/ls-grep/script-01.sh new file mode 100755 index 00000000..5481774d --- /dev/null +++ b/expect/shell-pipelines/ls-grep/script-01.sh @@ -0,0 +1,11 @@ +Ariane +Daniel +HoChiMinh +KualaLumpur +Levi +London +NewYork +Niamh +Olga +York +dHondt diff --git a/expect/shell-pipelines/ls-grep/script-02.sh b/expect/shell-pipelines/ls-grep/script-02.sh new file mode 100755 index 00000000..35f2e44e --- /dev/null +++ b/expect/shell-pipelines/ls-grep/script-02.sh @@ -0,0 +1,10 @@ +Ariane +Daniel +HoChiMinh +KualaLumpur +Levi +London +NewYork +Niamh +Olga +York diff --git a/expect/shell-pipelines/ls-grep/script-03.sh b/expect/shell-pipelines/ls-grep/script-03.sh new file mode 100755 index 00000000..37ec4508 --- /dev/null +++ b/expect/shell-pipelines/ls-grep/script-03.sh @@ -0,0 +1,7 @@ +Ariane +Daniel +Levi +London +Niamh +Olga +York diff --git a/expect/shell-pipelines/ls-grep/script-04.sh b/expect/shell-pipelines/ls-grep/script-04.sh new file mode 100755 index 00000000..7f8f011e --- /dev/null +++ b/expect/shell-pipelines/ls-grep/script-04.sh @@ -0,0 +1 @@ +7 diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-01.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-01.sh new file mode 100755 index 00000000..a622bc92 --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-01.sh @@ -0,0 +1,6 @@ +Ahmed London 1 10 4 +Basia London 22 9 6 +Chandra Birmingham 12 6 +Leila London 1 +Mehmet Birmingham 3 12 17 +Piotr Glasgow 15 2 25 11 8 diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-02.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-02.sh new file mode 100755 index 00000000..c560f609 --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-02.sh @@ -0,0 +1,6 @@ +Basia London 22 9 6 +Piotr Glasgow 15 2 25 11 8 +Chandra Birmingham 12 6 +Mehmet Birmingham 3 12 17 +Leila London 1 +Ahmed London 1 10 4 diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-03.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-03.sh new file mode 100755 index 00000000..52d05bc6 --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-03.sh @@ -0,0 +1,3 @@ +Basia London 22 9 6 +Piotr Glasgow 15 2 25 11 8 +Chandra Birmingham 12 6 diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-04.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-04.sh new file mode 100755 index 00000000..9c18f93d --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-04.sh @@ -0,0 +1 @@ +Piotr Glasgow 15 2 25 11 8 diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-05.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-05.sh new file mode 100755 index 00000000..5b6440e3 --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-05.sh @@ -0,0 +1,6 @@ +Entry German +Entry Mariana +Entry Sally +Exit German +Exit Mariana +Exit Sally diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-06.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-06.sh new file mode 100755 index 00000000..93bd06bc --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-06.sh @@ -0,0 +1,2 @@ + 5 Entry + 4 Exit diff --git a/expect/shell-pipelines/sort-uniq-head-tail/script-07.sh b/expect/shell-pipelines/sort-uniq-head-tail/script-07.sh new file mode 100755 index 00000000..93bd06bc --- /dev/null +++ b/expect/shell-pipelines/sort-uniq-head-tail/script-07.sh @@ -0,0 +1,2 @@ + 5 Entry + 4 Exit diff --git a/expect/shell-pipelines/tr/script-01.sh b/expect/shell-pipelines/tr/script-01.sh new file mode 100755 index 00000000..8dea4ebf --- /dev/null +++ b/expect/shell-pipelines/tr/script-01.sh @@ -0,0 +1,11 @@ +Dear Yara, + +Mz apologies for sending this response so late. As zou know, there's been a lot going on. + +Unfortunatelz I don't think I'll be able to make it to Yimbabwe, but but sounds amaying. + +Hope zou're doing well, and enjoz the trip. + +Thanks, + +Karolina diff --git a/expect/shell-pipelines/tr/script-02.sh b/expect/shell-pipelines/tr/script-02.sh new file mode 100755 index 00000000..e00561af --- /dev/null +++ b/expect/shell-pipelines/tr/script-02.sh @@ -0,0 +1,11 @@ +Dear Zara, + +My apologies for sending this response so late. As you know, there's been a lot going on! + +Unfortunately I don't think I'll be able to make it to Zimbabwe, but but sounds amazing! + +Hope you're doing well, and enjoy the trip! + +Thanks, + +Karolina diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 8db4390a..90e2397d 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. +awk '{print $1}' scores-table.txt diff --git a/individual-shell-tools/awk/script-02.sh b/individual-shell-tools/awk/script-02.sh index 5956be9b..a9e6a11c 100755 --- a/individual-shell-tools/awk/script-02.sh +++ b/individual-shell-tools/awk/script-02.sh @@ -4,3 +4,6 @@ set -euo pipefail # TODO: Write a command to output the names of each player, as well as their city. # Your output should contain 6 lines, each with two words on it, separated by a space. +awk '{print $1, $2}' scores-table.txt +# Or alternatively, if we need more control over the formatting: +awk '{printf "%s %s\n", $1, $2}' scores-table.txt diff --git a/individual-shell-tools/awk/script-03.sh b/individual-shell-tools/awk/script-03.sh index af7c6e8b..9c2945bf 100755 --- a/individual-shell-tools/awk/script-03.sh +++ b/individual-shell-tools/awk/script-03.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the score from their first attempt. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 1". +awk '{printf "%s %s\n", $1, $3}' scores-table.txt diff --git a/individual-shell-tools/awk/script-04.sh b/individual-shell-tools/awk/script-04.sh index bf15703c..22f203a2 100755 --- a/individual-shell-tools/awk/script-04.sh +++ b/individual-shell-tools/awk/script-04.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in London along with the score from their last attempt. # Your output should contain 3 lines, each with one word and one number on it. # The first line should be "Ahmed 4". +awk '$2 == "London" {printf "%s %s\n", $1, $NF}' scores-table.txt diff --git a/individual-shell-tools/awk/script-05.sh b/individual-shell-tools/awk/script-05.sh index d1680cb0..53aafa22 100755 --- a/individual-shell-tools/awk/script-05.sh +++ b/individual-shell-tools/awk/script-05.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the number of times they've played the game. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 3". +awk '{printf "%s %d\n", $1, NF-2}' scores-table.txt diff --git a/individual-shell-tools/awk/script-06-stretch.sh b/individual-shell-tools/awk/script-06-stretch.sh index 0201e637..841f6019 100755 --- a/individual-shell-tools/awk/script-06-stretch.sh +++ b/individual-shell-tools/awk/script-06-stretch.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output the total of adding together all players' first scores. # Your output should be exactly the number 54. +awk '{sum += $3} END {print sum}' scores-table.txt diff --git a/individual-shell-tools/awk/script-07-stretch.sh b/individual-shell-tools/awk/script-07-stretch.sh index 3f715588..fd95b80a 100755 --- a/individual-shell-tools/awk/script-07-stretch.sh +++ b/individual-shell-tools/awk/script-07-stretch.sh @@ -7,3 +7,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the total of adding all of that player's scores. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 15". The second line should be "Basia 37" +awk '{total=0 ; for (i=2; i<=NF; i++) {total += $i} ; print $1, total}' scores-table.txt diff --git a/individual-shell-tools/cat/script-01.sh b/individual-shell-tools/cat/script-01.sh index c85053e0..edcc54fb 100755 --- a/individual-shell-tools/cat/script-01.sh +++ b/individual-shell-tools/cat/script-01.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output the contents of the helper-1.txt file inside the helper-files directory to the terminal. # The output of this command should be "Once upon a time...". +cat ../helper-files/helper-1.txt diff --git a/individual-shell-tools/cat/script-02.sh b/individual-shell-tools/cat/script-02.sh index 01bbd5ea..d8187ff4 100755 --- a/individual-shell-tools/cat/script-02.sh +++ b/individual-shell-tools/cat/script-02.sh @@ -11,3 +11,4 @@ set -euo pipefail # It looked delicious. # I was tempted to take a bite of it. # But this seemed like a bad idea... +cat ../helper-files/* diff --git a/individual-shell-tools/cat/script-03.sh b/individual-shell-tools/cat/script-03.sh index 37573b0c..dd6b1d8b 100755 --- a/individual-shell-tools/cat/script-03.sh +++ b/individual-shell-tools/cat/script-03.sh @@ -9,3 +9,4 @@ set -euo pipefail # 1 It looked delicious. # 2 I was tempted to take a bite of it. # 3 But this seemed like a bad idea... +cat -n ../helper-files/helper-3.txt diff --git a/individual-shell-tools/cat/script-04-stretch.sh b/individual-shell-tools/cat/script-04-stretch.sh index 00fe3c48..70f8fdb6 100755 --- a/individual-shell-tools/cat/script-04-stretch.sh +++ b/individual-shell-tools/cat/script-04-stretch.sh @@ -13,3 +13,4 @@ set -euo pipefail # 3 It looked delicious. # 4 I was tempted to take a bite of it. # 5 But this seemed like a bad idea... +cat ../helper-files/* | cat -n diff --git a/individual-shell-tools/grep/script-01.sh b/individual-shell-tools/grep/script-01.sh index fb05f42f..f374150c 100755 --- a/individual-shell-tools/grep/script-01.sh +++ b/individual-shell-tools/grep/script-01.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output every line in dialogue.txt said by the Doctor. # The output should contain 6 lines. +grep "^Doctor:" dialogue.txt diff --git a/individual-shell-tools/grep/script-02.sh b/individual-shell-tools/grep/script-02.sh index df6f8564..31d35703 100755 --- a/individual-shell-tools/grep/script-02.sh +++ b/individual-shell-tools/grep/script-02.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output every line in dialogue.txt that contains the word Doctor (regardless of case). # The output should contain 9 lines. +grep -i "doctor" dialogue.txt diff --git a/individual-shell-tools/grep/script-03.sh b/individual-shell-tools/grep/script-03.sh index 5383fe57..f6f25b87 100755 --- a/individual-shell-tools/grep/script-03.sh +++ b/individual-shell-tools/grep/script-03.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output the number of lines in dialogue.txt that contain the word Doctor (regardless of case). # The output should be exactly the number 9. +grep -c -i "doctor" dialogue.txt diff --git a/individual-shell-tools/grep/script-04.sh b/individual-shell-tools/grep/script-04.sh index 80ee0477..886a42ed 100755 --- a/individual-shell-tools/grep/script-04.sh +++ b/individual-shell-tools/grep/script-04.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output every line in dialogue.txt that does not contain the word "Hello" (regardless of case). # The output should contain 10 lines. +grep -v -i "hello" dialogue.txt diff --git a/individual-shell-tools/grep/script-05.sh b/individual-shell-tools/grep/script-05.sh index 1eb53818..8754273d 100755 --- a/individual-shell-tools/grep/script-05.sh +++ b/individual-shell-tools/grep/script-05.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output every line in dialogue.txt that contains the string "cure", as well as the line before that line. # The output should contain two pairs of two lines of text (with a separator between them). +grep -B1 "cure" dialogue.txt diff --git a/individual-shell-tools/grep/script-06.sh b/individual-shell-tools/grep/script-06.sh index 5670e3b6..0e8244ff 100755 --- a/individual-shell-tools/grep/script-06.sh +++ b/individual-shell-tools/grep/script-06.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output the name of every `.txt` file in this directory which contains a line of dialogue said by the Doctor. # The output should contain two filenames. +grep -l "^Doctor:" *.txt diff --git a/individual-shell-tools/grep/script-07.sh b/individual-shell-tools/grep/script-07.sh index 9670ebad..9fabc87f 100755 --- a/individual-shell-tools/grep/script-07.sh +++ b/individual-shell-tools/grep/script-07.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output, for each `.txt` file in this directory, how many lines of dialogue the Doctor has. # The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0. +grep -c "^Doctor:" *.txt diff --git a/individual-shell-tools/ls/script-01.sh b/individual-shell-tools/ls/script-01.sh index 241b62f5..c9cd189b 100755 --- a/individual-shell-tools/ls/script-01.sh +++ b/individual-shell-tools/ls/script-01.sh @@ -13,3 +13,4 @@ fi # TODO: Write a command to list the files and folders in this directory. # The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more. +ls diff --git a/individual-shell-tools/ls/script-02.sh b/individual-shell-tools/ls/script-02.sh index d0a5a10f..d3717572 100755 --- a/individual-shell-tools/ls/script-02.sh +++ b/individual-shell-tools/ls/script-02.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command which lists all of the files in the directory named child-directory. # The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt. +ls child-directory diff --git a/individual-shell-tools/ls/script-03.sh b/individual-shell-tools/ls/script-03.sh index 781216d2..5161171e 100755 --- a/individual-shell-tools/ls/script-03.sh +++ b/individual-shell-tools/ls/script-03.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command which _recursively_ lists all of the files and folders in this directory _and_ all of the files inside those folders. # The output should be a list of names including: child-directory, script-01.sh, helper-1.txt (and more). # The formatting of the output doesn't matter. +ls -R diff --git a/individual-shell-tools/ls/script-04.sh b/individual-shell-tools/ls/script-04.sh index 72f3817b..b4bdb1f5 100755 --- a/individual-shell-tools/ls/script-04.sh +++ b/individual-shell-tools/ls/script-04.sh @@ -15,9 +15,10 @@ echo "First exercise (sorted newest to oldest):" # TODO: Write a command which lists the files in the child-directory directory, one per line, sorted so that the most recently modified file is first. # The output should be a list of names in this order, one per line: helper-3.txt, helper-1.txt, helper-2.txt. - +ls -1 -t child-directory echo "Second exercise (sorted oldest to newest):" # TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first). # The output should be a list of names in this order, one per line: helper-2.txt, helper-1.txt, helper-3.txt. +ls -1 -t -r child-directory diff --git a/individual-shell-tools/sed/script-01.sh b/individual-shell-tools/sed/script-01.sh index 3eba6fa4..ba68ff31 100755 --- a/individual-shell-tools/sed/script-01.sh +++ b/individual-shell-tools/sed/script-01.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command to output input.txt with all occurrences of the letter `i` replaced with `I`. # The output should contain 11 lines. # The first line of the output should be: "ThIs Is a sample fIle for experImentIng with sed.". +sed -e 's/i/I/g' input.txt diff --git a/individual-shell-tools/sed/script-02.sh b/individual-shell-tools/sed/script-02.sh index abdd64d0..be485a0a 100755 --- a/individual-shell-tools/sed/script-02.sh +++ b/individual-shell-tools/sed/script-02.sh @@ -5,3 +5,4 @@ set -euo pipefail # TODO: Write a command to output input.txt with numbers removed. # The output should contain 11 lines. # Line 6 of the output should be " Alisha". +sed 's/[0-9]//g' input.txt diff --git a/individual-shell-tools/sed/script-03.sh b/individual-shell-tools/sed/script-03.sh index dd284a29..cebc0912 100755 --- a/individual-shell-tools/sed/script-03.sh +++ b/individual-shell-tools/sed/script-03.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output input.txt removing any line which contains a number. # The output should contain 6 lines. +sed -e '/[0-9]/d' input.txt diff --git a/individual-shell-tools/sed/script-04.sh b/individual-shell-tools/sed/script-04.sh index 0052ac6c..3b6ed6f1 100755 --- a/individual-shell-tools/sed/script-04.sh +++ b/individual-shell-tools/sed/script-04.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output input.txt replacing every occurrence of the string "We'll" with "We will". # The output should contain 11 lines. +sed -e "s/We\'ll/We will/g" input.txt diff --git a/individual-shell-tools/sed/script-05.sh b/individual-shell-tools/sed/script-05.sh index 2dcc91a0..d5305aa9 100755 --- a/individual-shell-tools/sed/script-05.sh +++ b/individual-shell-tools/sed/script-05.sh @@ -6,3 +6,4 @@ set -euo pipefail # If a line starts with a number and a space, make the line instead end with a space and the number. # So line 6 which currently reads "37 Alisha" should instead read "Alisha 37". # The output should contain 11 lines. +sed -e 's/^\([0-9]*\) \(.*\)$/\2 \1/' input.txt diff --git a/individual-shell-tools/sed/script-06.sh b/individual-shell-tools/sed/script-06.sh index 0b939017..9d685b3b 100755 --- a/individual-shell-tools/sed/script-06.sh +++ b/individual-shell-tools/sed/script-06.sh @@ -8,3 +8,4 @@ set -euo pipefail # The output should contain 11 lines. # Line 3 should be "It contains many lines, and there are some things you may want to do with each of them.". # Line 11 should be "We also should remember, when we go shopping, to get 4 items: oranges, cheese, bread, olives.". +sed -e 's/,\([^ ]\)/, \1/g' input.txt diff --git a/individual-shell-tools/wc/script-01.sh b/individual-shell-tools/wc/script-01.sh index c9dd6e5d..c944eeaf 100755 --- a/individual-shell-tools/wc/script-01.sh +++ b/individual-shell-tools/wc/script-01.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output the number of words in the file helper-files/helper-3.txt. # The output should include the number 19. The output should not include the number 92. +wc -w ../helper-files/helper-3.txt diff --git a/individual-shell-tools/wc/script-02.sh b/individual-shell-tools/wc/script-02.sh index 8feeb1a6..16e53091 100755 --- a/individual-shell-tools/wc/script-02.sh +++ b/individual-shell-tools/wc/script-02.sh @@ -4,3 +4,4 @@ set -euo pipefail # TODO: Write a command to output the number of lines in the file helper-files/helper-3.txt. # The output should include the number 3. The output should not include the number 19. +wc -l ../helper-files/helper-3.txt diff --git a/individual-shell-tools/wc/script-03.sh b/individual-shell-tools/wc/script-03.sh index 6b2e9d3d..6ac2210d 100755 --- a/individual-shell-tools/wc/script-03.sh +++ b/individual-shell-tools/wc/script-03.sh @@ -8,3 +8,4 @@ set -euo pipefail # 1 7 39 ../helper-files/helper-2.txt # 3 19 92 ../helper-files/helper-3.txt # 5 30 151 total +wc ../helper-files/* diff --git a/jq/script-01.sh b/jq/script-01.sh index 95827f68..0d69705d 100755 --- a/jq/script-01.sh +++ b/jq/script-01.sh @@ -5,3 +5,4 @@ set -euo pipefail # The input for this script is the person.json file. # TODO: Write a command to output the name of the person. # Your output should be exactly the string "Selma", but should not contain any quote characters. +jq -r '.name' person.json diff --git a/jq/script-02.sh b/jq/script-02.sh index 21544d67..74a3ded8 100755 --- a/jq/script-02.sh +++ b/jq/script-02.sh @@ -5,3 +5,4 @@ set -euo pipefail # The input for this script is the person.json file. # TODO: Write a command to output the address of the person, all on one line, with a comma between each line. # Your output should be exactly the string "35 Fashion Street, London, E1 6PX", but should not contain any quote characters. +jq -r '.address | join(", ")' person.json diff --git a/jq/script-03.sh b/jq/script-03.sh index 3566f03b..6a2f566a 100755 --- a/jq/script-03.sh +++ b/jq/script-03.sh @@ -5,3 +5,6 @@ set -euo pipefail # The input for this script is the person.json file. # TODO: Write a command to output the name of the person, then a comma, then their profession. # Your output should be exactly the string "Selma, Software Engineer", but should not contain any quote characters. +jq -r '[ .name, .profession ] | join(", ")' person.json +# Or alternatively, we can do two selects in a string interpolation: +jq -r '"\(.name), \(.profession)"' person.json diff --git a/jq/script-04.sh b/jq/script-04.sh index 015997e1..e50f742a 100755 --- a/jq/script-04.sh +++ b/jq/script-04.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player, one per line. # Your output should contain 6 lines, each with just one word on it. # Your output should not contain any quote characters. +jq -r '.[].name' scores.json diff --git a/jq/script-05.sh b/jq/script-05.sh index 993fc9ee..ab78fbad 100755 --- a/jq/script-05.sh +++ b/jq/script-05.sh @@ -5,3 +5,4 @@ set -euo pipefail # The input for this script is the scores.json file. # TODO: Write a command to output the names of each player, as well as their city. # Your output should contain 6 lines, each with two words on it. +jq -r '.[] | "\(.name) \(.city)"' scores.json diff --git a/jq/script-06.sh b/jq/script-06.sh index 8b6e74c5..47fee35b 100755 --- a/jq/script-06.sh +++ b/jq/script-06.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the score from their first attempt. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 1" with no quotes. +jq -r '.[] | "\(.name) \(.scores[0])"' scores.json diff --git a/jq/script-07.sh b/jq/script-07.sh index d43f93d1..f20ab3d7 100755 --- a/jq/script-07.sh +++ b/jq/script-07.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the score from their last attempt. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 4" with no quotes. +jq -r '.[] | "\(.name) \(.scores[-1])"' scores.json diff --git a/jq/script-08.sh b/jq/script-08.sh index 6671fd1b..165e67a4 100755 --- a/jq/script-08.sh +++ b/jq/script-08.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the number of times they've played the game. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 3" with no quotes. +jq -r '.[] | "\(.name) \(.scores | length)"' scores.json diff --git a/jq/script-09.sh b/jq/script-09.sh index c2536a53..3ce4c2b7 100755 --- a/jq/script-09.sh +++ b/jq/script-09.sh @@ -6,3 +6,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player along with the total scores from all of their games added together. # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 15" with no quotes. +jq -r '.[] | "\(.name) \(.scores | add)"' scores.json diff --git a/jq/script-10.sh b/jq/script-10.sh index 8e9d75f0..8b124325 100755 --- a/jq/script-10.sh +++ b/jq/script-10.sh @@ -5,3 +5,4 @@ set -euo pipefail # The input for this script is the scores.json file. # TODO: Write a command to output the total of adding together all players' first scores. # Your output should be exactly the number 54. +jq -r '[.[].scores[0]] | add' scores.json diff --git a/jq/script-11.sh b/jq/script-11.sh index d2337a6b..da686da5 100755 --- a/jq/script-11.sh +++ b/jq/script-11.sh @@ -5,3 +5,4 @@ set -euo pipefail # The input for this script is the scores.json file. # TODO: Write a command to output the total of adding together all scores from all games from all players. # Your output should be exactly the number 164. +jq -r '[.[].scores | add] | add' scores.json diff --git a/shell-pipelines/ls-grep/script-01.sh b/shell-pipelines/ls-grep/script-01.sh index 8c7d968a..b77993b2 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 16f5f71d..4fa4206c 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 a302ab03..9b79f1c8 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 c000b7e3..b9b1fef9 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 171e1f98..845ad89d 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 29c3c252..baa6b861 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 -n -k3 -r 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 bcbaf342..23eb6792 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 -n -k3 -r scores-table.txt | head -n3 diff --git a/shell-pipelines/sort-uniq-head-tail/script-04.sh b/shell-pipelines/sort-uniq-head-tail/script-04.sh index 65a5cfba..93c88aa9 100755 --- a/shell-pipelines/sort-uniq-head-tail/script-04.sh +++ b/shell-pipelines/sort-uniq-head-tail/script-04.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 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 -n -k3 -r scores-table.txt | tail -n+2 | head -n1 diff --git a/shell-pipelines/sort-uniq-head-tail/script-05.sh b/shell-pipelines/sort-uniq-head-tail/script-05.sh index a93cd9f9..8eba57e3 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 715c7ae5..e2fc1be4 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. +awk '{print $1}' events.txt | sort | uniq -c diff --git a/shell-pipelines/sort-uniq-head-tail/script-07.sh b/shell-pipelines/sort-uniq-head-tail/script-07.sh index 7fd07e1f..ed7481d6 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. +tail -n+2 events-with-timestamps.txt | awk '{print $3}' | sort | uniq -c diff --git a/shell-pipelines/tr/script-01.sh b/shell-pipelines/tr/script-01.sh index 8bb0211e..75c3ed25 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 (.). +cat text.txt | tr '!' '.' diff --git a/shell-pipelines/tr/script-02.sh b/shell-pipelines/tr/script-02.sh index cf3a503a..f8c4121c 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). +cat text.txt | tr 'yzYZ' 'zyZY' diff --git a/test-sdc.sh b/test-sdc.sh new file mode 100755 index 00000000..aa5d020e --- /dev/null +++ b/test-sdc.sh @@ -0,0 +1,94 @@ +# This test file will be automatically run when you submit a pull request +# You should not modify this file +# You can run this file using ./test-sdc.sh task-directory-name to check your output +# You can use it with the individual-shell-tools, jq, and shell-pipelines tasks + +rm testoutput.txt +if [[ "$1" == "individual-shell-tools" ]]; then + cd individual-shell-tools + pass=0 + total=0 + for directory in */; do + cd $directory + if [ "$directory" == "helper-files/" ]; then + cd .. + continue + fi + for exercise in *.sh; do + total=$(($total+1)) + ./$exercise > ../../test.tmp + cmp ../../test.tmp ../../expect/individual-shell-tools/$directory$exercise --quiet + if [ $? -eq 0 ]; then + pass=$(($pass+1)) + else + if [[ "$exercise" == *"stretch"* ]]; then + # echo "Stretch task $directory$exercise failing, you can ignore this if you did not attempt. If you didnt, please have the volunteer check this." + echo "" >> ../../testoutput.txt + else + echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt + fi + fi + done + cd .. + done + cd .. + rm test.tmp + echo "You passed $pass/$total tasks." >> testoutput.txt + if [ $pass -eq $total ]; then + echo "This task is complete!" >> testoutput.txt + fi + cat testoutput.txt +elif [[ "$1" == "shell-pipelines" ]]; then + cd shell-pipelines + pass=0 + total=0 + for directory in */; do + cd $directory + for exercise in *.sh; do + total=$(($total+1)) + ./$exercise > ../../test.tmp + cmp ../../test.tmp ../../expect/shell-pipelines/$directory$exercise --quiet + if [ $? -eq 0 ]; then + pass=$(($pass+1)) + else + if [[ "$exercise" == *"stretch"* ]]; then + # echo "Stretch task $directory$exercise failing, you can ignore this if you did not attempt. If you didnt, please have the volunteer check this." + echo "" >> ../../testoutput.txt + else + echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt + fi + fi + done + cd .. + done + cd .. + rm test.tmp + echo "You passed $pass/$total tasks." >> testoutput.txt + if [ $pass -eq $total ]; then + echo "This task is complete!" >> testoutput.txt + fi + cat testoutput.txt +elif [[ "$1" == "jq" ]]; then + cd jq + pass=0 + total=0 + for exercise in *.sh; do + total=$(($total+1)) + ./$exercise > ../test.tmp + cmp ../test.tmp ../expect/jq/$exercise --quiet + if [ $? -eq 0 ]; then + pass=$(($pass+1)) + else + echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt + fi + done + cd .. + rm test.tmp + echo "You passed $pass/$total tasks." >> testoutput.txt + if [ $pass -eq $total ]; then + echo "This task is complete!" >> testoutput.txt + fi + cat testoutput.txt +else + echo "Please run this with a valid test directory name as argument" +fi From 5938b10a27042d628da092f0a30bd175e0bc6cfc Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 11:58:19 +0000 Subject: [PATCH 02/20] fix yaml --- .github/workflows/test-sdc-tasks.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 08fe2aa1..1a2e50a6 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,10 +1,11 @@ name: Test SDC Tasks -on: pull_request - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' +on: + pull_request: + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' pull_request_target: types: - labeled From ef760a0a0050672c490821ac6a05768ba6f07714 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:00:18 +0000 Subject: [PATCH 03/20] fix yaml for testing --- .github/workflows/test-sdc-tasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 1a2e50a6..e418d83f 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,7 +1,7 @@ name: Test SDC Tasks on: - pull_request: + [push, pull_request]: paths: - 'individual-shell-tools/**.sh' - 'shell-pipelines/**.sh' From 33b788d1199f81849c324a60677cb48f5257bf77 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:01:06 +0000 Subject: [PATCH 04/20] allow testing on push --- .github/workflows/test-sdc-tasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index e418d83f..00ec5b42 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,7 +1,7 @@ name: Test SDC Tasks on: - [push, pull_request]: + push: paths: - 'individual-shell-tools/**.sh' - 'shell-pipelines/**.sh' From a9be07114e13abf6205a5c9de93a6f1d139533e2 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:02:26 +0000 Subject: [PATCH 05/20] deliberately break an implementation --- individual-shell-tools/awk/script-01.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 90e2397d..4d9de4d5 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $1}' scores-table.txt +awk '{print $121212131}' scores-table.txt # deliberately break this implementation From 7eb4f880584e2ee0c376896e0e2dde4ee338d8dc Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:04:33 +0000 Subject: [PATCH 06/20] don't pull expected from branch --- .github/workflows/test-sdc-tasks.yml | 10 +++++----- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 00ec5b42..02b8729d 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -27,11 +27,11 @@ jobs: uses: actions/checkout@v5 # with: # fetch-depth: 2 - - name: checkout expected output - uses: actions/checkout@v5 - with: - ref: origin/expected-solutions - path: expect + # - name: checkout expected output + # uses: actions/checkout@v5 + # with: + # ref: origin/expected-solutions + # path: expect - name: Get changed files id: changed-files uses: tj-actions/changed-files@v47.0.5 diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 4d9de4d5..c3e22b6f 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $121212131}' scores-table.txt # deliberately break this implementation +awk '{print ' scores-table.txt # deliberately break this implementation From c5e2f60d6522e59ac8ccb1d39cb86319c846d304 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:07:53 +0000 Subject: [PATCH 07/20] fix output eof --- .github/workflows/test-sdc-tasks.yml | 3 +-- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 02b8729d..5eb8c076 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -57,10 +57,9 @@ jobs: - name: read test output id: read-test-output run: | - # Read output.txt and write to GITHUB_OUTPUT echo 'testoutput<> $GITHUB_OUTPUT cat testoutput.txt >> $GITHUB_OUTPUT - echo EOF + echo EOF >> $GITHUB_OUTPUT - name: make output comment uses: peter-evans/create-or-update-comment@v5.0.0 with: diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index c3e22b6f..ba38faa0 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print ' scores-table.txt # deliberately break this implementation +awk '{print qqqq' scores-table.txt # deliberately break this implementation From 06abe78a0904b88541ed4b0458572c89fe03966f Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:13:12 +0000 Subject: [PATCH 08/20] attempt to get pr number differently --- .github/workflows/test-sdc-tasks.yml | 13 ++++++++++++- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 5eb8c076..388a4a53 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -60,9 +60,20 @@ jobs: echo 'testoutput<> $GITHUB_OUTPUT cat testoutput.txt >> $GITHUB_OUTPUT echo EOF >> $GITHUB_OUTPUT + - uses: actions/github-script@v7 + id: get_pr_data + with: + script: | + return ( + await github.rest.repos.listPullRequestsAssociatedWithCommit({ + commit_sha: context.sha, + owner: context.repo.owner, + repo: context.repo.repo, + }) + ).data[0]; - name: make output comment uses: peter-evans/create-or-update-comment@v5.0.0 with: - issue-number: ${{ github.event.number }} + issue-number: ${{ fromJson(steps.get_pr_data.outputs.result).number }} # ${{ github.event.number }} body: ${{ steps.read-test-output.outputs.testoutput }} diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index ba38faa0..2f2dd36b 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print qqqq' scores-table.txt # deliberately break this implementation +awk '{print qqqqa' scores-table.txt # deliberately break this implementation From 377fc234e0453afdaefc77f096a0377e72f5c55c Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:16:25 +0000 Subject: [PATCH 09/20] update action permissions --- .github/workflows/test-sdc-tasks.yml | 2 +- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 388a4a53..7d7cc1e8 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -20,7 +20,7 @@ jobs: name: Test SDC Tasks runs-on: ubuntu-slim permissions: - pull-requests: read + pull-requests: write steps: - name: checkout pushed PR diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 2f2dd36b..515c8b34 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print qqqqa' scores-table.txt # deliberately break this implementation +awk '{print qqqqaaaa' scores-table.txt # deliberately break this implementation From cc111c988c6e5fd35c7694bafcc94db75a15c559 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:31:08 +0000 Subject: [PATCH 10/20] labelling pr --- .github/workflows/test-sdc-tasks.yml | 63 ++++++++++++++++--------- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 7d7cc1e8..f05e9835 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,18 +1,23 @@ name: Test SDC Tasks on: - push: + # push: + # paths: + # - 'individual-shell-tools/**.sh' + # - 'shell-pipelines/**.sh' + # - 'jq/*.sh' + pull_request: paths: - 'individual-shell-tools/**.sh' - 'shell-pipelines/**.sh' - 'jq/*.sh' - pull_request_target: - types: - - labeled - - unlabeled - - opened - - edited - - reopened + # pull_request_target: + # types: + # - labeled + # - unlabeled + # - opened + # - edited + # - reopened jobs: test_sdc_tasks: @@ -60,20 +65,36 @@ jobs: echo 'testoutput<> $GITHUB_OUTPUT cat testoutput.txt >> $GITHUB_OUTPUT echo EOF >> $GITHUB_OUTPUT - - uses: actions/github-script@v7 - id: get_pr_data - with: - script: | - return ( - await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }) - ).data[0]; + # - uses: actions/github-script@v7 + # id: get_pr_data + # with: # this isn't going to work with a fork pr + # script: | + # return ( + # await github.rest.repos.listPullRequestsAssociatedWithCommit({ + # commit_sha: context.sha, + # owner: context.repo.owner, + # repo: context.repo.repo, + # }) + # ).data[0]; - name: make output comment uses: peter-evans/create-or-update-comment@v5.0.0 with: - issue-number: ${{ fromJson(steps.get_pr_data.outputs.result).number }} # ${{ github.event.number }} + issue-number: ${{ github.event.number }} # ${{ fromJson(steps.get_pr_data.outputs.result).number }} body: ${{ steps.read-test-output.outputs.testoutput }} - + - uses: actions/github-script@v7 + id: update-labels + if: contains(steps.read-test-output.outputs.testoutput, 'complete!') + with: + script: | + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: ${{ github.event.number }}, + labels: ["Complete"] + }); + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: ${{ github.event.number }}, + name: "Needs Review" + }); diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 515c8b34..1dc4069b 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print qqqqaaaa' scores-table.txt # deliberately break this implementation +awk '{print $1}' scores-table.txt # deliberately break this implementation From bf0b1e329cf5a7efc93a622975ee67091ab3e9ff Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 12:35:42 +0000 Subject: [PATCH 11/20] fix triggers --- .github/workflows/test-sdc-tasks.yml | 22 +++++++--------------- individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index f05e9835..05bfa43a 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -6,18 +6,17 @@ on: # - 'individual-shell-tools/**.sh' # - 'shell-pipelines/**.sh' # - 'jq/*.sh' - pull_request: + pull_request_target: paths: - 'individual-shell-tools/**.sh' - 'shell-pipelines/**.sh' - 'jq/*.sh' - # pull_request_target: - # types: - # - labeled - # - unlabeled - # - opened - # - edited - # - reopened + types: + - labeled + - unlabeled + - opened + - edited + - reopened jobs: test_sdc_tasks: @@ -30,13 +29,6 @@ jobs: steps: - name: checkout pushed PR uses: actions/checkout@v5 - # with: - # fetch-depth: 2 - # - name: checkout expected output - # uses: actions/checkout@v5 - # with: - # ref: origin/expected-solutions - # path: expect - name: Get changed files id: changed-files uses: tj-actions/changed-files@v47.0.5 diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 1dc4069b..90e2397d 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $1}' scores-table.txt # deliberately break this implementation +awk '{print $1}' scores-table.txt From 6191edb597fa7e5623c6e308321a5e3a0fb2532d Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 13:25:45 +0000 Subject: [PATCH 12/20] try to get triggers working --- .github/workflows/test-sdc-tasks.yml | 11 +++++++++++ individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 05bfa43a..ccd5989b 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -6,6 +6,17 @@ on: # - 'individual-shell-tools/**.sh' # - 'shell-pipelines/**.sh' # - 'jq/*.sh' + pull_request: + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' + types: + - labeled + - unlabeled + - opened + - edited + - reopened pull_request_target: paths: - 'individual-shell-tools/**.sh' diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 90e2397d..190c4ad6 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $1}' scores-table.txt +awk '{print $1}' scores-table.txt # From c098dab49158b986c6f37a7f5d9a20bce4b678d2 Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 13:53:53 +0000 Subject: [PATCH 13/20] run on all PR label events --- .github/workflows/test-sdc-tasks.yml | 31 +++++++++++++------------ individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index ccd5989b..61db601d 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -6,22 +6,22 @@ on: # - 'individual-shell-tools/**.sh' # - 'shell-pipelines/**.sh' # - 'jq/*.sh' - pull_request: - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' - types: - - labeled - - unlabeled - - opened - - edited - - reopened + # pull_request: + # # paths: # i think its not working because paths are never updated if the type is updated + # # - 'individual-shell-tools/**.sh' + # # - 'shell-pipelines/**.sh' + # # - 'jq/*.sh' + # types: + # - labeled + # - unlabeled + # - opened + # - edited + # - reopened pull_request_target: - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' + # paths: + # - 'individual-shell-tools/**.sh' + # - 'shell-pipelines/**.sh' + # - 'jq/*.sh' types: - labeled - unlabeled @@ -63,6 +63,7 @@ jobs: run: ./test-sdc.sh shell-pipelines shell: bash - name: read test output + if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh') id: read-test-output run: | echo 'testoutput<> $GITHUB_OUTPUT diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 190c4ad6..90e2397d 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $1}' scores-table.txt # +awk '{print $1}' scores-table.txt From 0e0cab727efbf21e27fd0e60ea5c32845a8dc53e Mon Sep 17 00:00:00 2001 From: l Date: Wed, 25 Mar 2026 13:54:13 +0000 Subject: [PATCH 14/20] run on all pr label events --- number-systems/README.md | 40 ++++++++++++++++++++-------------------- test-sdc.sh | 10 +++------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/number-systems/README.md b/number-systems/README.md index 77a3bde9..da424df4 100644 --- a/number-systems/README.md +++ b/number-systems/README.md @@ -5,61 +5,61 @@ Do not convert any binary numbers to decimal when solving a question unless the The goal of these exercises is for you to gain an intuition for binary numbers. Using tools to solve the problems defeats the point. Convert the decimal number 14 to binary. -Answer: +Answer: 1110 Convert the binary number 101101 to decimal: -Answer: +Answer: 45 Which is larger: 1000 or 0111? -Answer: +Answer: 1000 Which is larger: 00100 or 01011? -Answer: +Answer: 01011 What is 10101 + 01010? -Answer: +Answer: 11111 What is 10001 + 10001? -Answer: +Answer: 100010 What's the largest number you can store with 4 bits, if you want to be able to represent the number 0? -Answer: +Answer: 15 How many bits would you need in order to store the numbers between 0 and 255 inclusive? -Answer: +Answer: 8 How many bits would you need in order to store the numbers between 0 and 3 inclusive? -Answer: +Answer: 2 How many bits would you need in order to store the numbers between 0 and 1000 inclusive? -Answer: +Answer: 10, but you'd have 23 spare values, so you can actually store between 0 and 1023 with 10 bits. How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)? -Answer: +Answer: Test that it has exactly one 1. Convert the decimal number 14 to hex. -Answer: +Answer: E Convert the decimal number 386 to hex. -Answer: +Answer: 182 Convert the hex number 386 to decimal. -Answer: +Answer: 902 Convert the hex number B to decimal. -Answer: +Answer: 11 If reading the byte 0x21 as a number, what decimal number would it mean? -Answer: +Answer: 33 If reading the byte 0x21 as an ASCII character, what character would it mean? -Answer: +Answer: ! If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean? -Answer: +Answer: Dark grey If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean? -Answer: +Answer: Purple. If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be? -Answer: +Answer: 170, 0, 255 diff --git a/test-sdc.sh b/test-sdc.sh index aa5d020e..2d5341e8 100755 --- a/test-sdc.sh +++ b/test-sdc.sh @@ -24,6 +24,7 @@ if [[ "$1" == "individual-shell-tools" ]]; then if [[ "$exercise" == *"stretch"* ]]; then # echo "Stretch task $directory$exercise failing, you can ignore this if you did not attempt. If you didnt, please have the volunteer check this." echo "" >> ../../testoutput.txt + total=$(($total-1)) else echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt fi @@ -34,7 +35,7 @@ if [[ "$1" == "individual-shell-tools" ]]; then cd .. rm test.tmp echo "You passed $pass/$total tasks." >> testoutput.txt - if [ $pass -eq $total ]; then + if [ $pass -ge $total ]; then echo "This task is complete!" >> testoutput.txt fi cat testoutput.txt @@ -51,12 +52,7 @@ elif [[ "$1" == "shell-pipelines" ]]; then if [ $? -eq 0 ]; then pass=$(($pass+1)) else - if [[ "$exercise" == *"stretch"* ]]; then - # echo "Stretch task $directory$exercise failing, you can ignore this if you did not attempt. If you didnt, please have the volunteer check this." - echo "" >> ../../testoutput.txt - else - echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt - fi + echo "Failed $directory$exercise, please either attempt again or have the volunteer check this." >> ../../testoutput.txt fi done cd .. From d2bebe300b3a57f2fce9362419b0fa057677951c Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:23:47 +0100 Subject: [PATCH 15/20] clean up yaml --- .github/workflows/test-sdc-tasks.yml | 45 ++++------------------------ 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 61db601d..2b1c48d3 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,27 +1,11 @@ name: Test SDC Tasks on: - # push: - # paths: - # - 'individual-shell-tools/**.sh' - # - 'shell-pipelines/**.sh' - # - 'jq/*.sh' - # pull_request: - # # paths: # i think its not working because paths are never updated if the type is updated - # # - 'individual-shell-tools/**.sh' - # # - 'shell-pipelines/**.sh' - # # - 'jq/*.sh' - # types: - # - labeled - # - unlabeled - # - opened - # - edited - # - reopened pull_request_target: - # paths: - # - 'individual-shell-tools/**.sh' - # - 'shell-pipelines/**.sh' - # - 'jq/*.sh' + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' types: - labeled - unlabeled @@ -43,13 +27,6 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v47.0.5 - - name: List all changed files - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - name: test individual shell tools if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') run: ./test-sdc.sh individual-shell-tools @@ -69,21 +46,11 @@ jobs: echo 'testoutput<> $GITHUB_OUTPUT cat testoutput.txt >> $GITHUB_OUTPUT echo EOF >> $GITHUB_OUTPUT - # - uses: actions/github-script@v7 - # id: get_pr_data - # with: # this isn't going to work with a fork pr - # script: | - # return ( - # await github.rest.repos.listPullRequestsAssociatedWithCommit({ - # commit_sha: context.sha, - # owner: context.repo.owner, - # repo: context.repo.repo, - # }) - # ).data[0]; + - name: make output comment uses: peter-evans/create-or-update-comment@v5.0.0 with: - issue-number: ${{ github.event.number }} # ${{ fromJson(steps.get_pr_data.outputs.result).number }} + issue-number: ${{ github.event.number }} body: ${{ steps.read-test-output.outputs.testoutput }} - uses: actions/github-script@v7 id: update-labels From 05c1ae10fa1c45e2cb05cfb4270b5e75d21f17b4 Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:38:10 +0100 Subject: [PATCH 16/20] use gh cli instead of template action --- .github/workflows/test-sdc-tasks.yml | 37 +++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 2b1c48d3..e8f4d88d 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -8,7 +8,6 @@ on: - 'jq/*.sh' types: - labeled - - unlabeled - opened - edited - reopened @@ -39,6 +38,13 @@ jobs: if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh') run: ./test-sdc.sh shell-pipelines shell: bash + - name: make output comment + if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh') + env: + GH_TOKEN: ${{ secrets.MY_TOKEN }} + ISSUE_URL: ${{ github.event.issue.html_url }} + run: | + gh issue comment $ISSUE_URL --body-FILE testoutput.TXT - name: read test output if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh') id: read-test-output @@ -46,26 +52,11 @@ jobs: echo 'testoutput<> $GITHUB_OUTPUT cat testoutput.txt >> $GITHUB_OUTPUT echo EOF >> $GITHUB_OUTPUT - - - name: make output comment - uses: peter-evans/create-or-update-comment@v5.0.0 - with: - issue-number: ${{ github.event.number }} - body: ${{ steps.read-test-output.outputs.testoutput }} - - uses: actions/github-script@v7 - id: update-labels + - name: add appropriate labels if: contains(steps.read-test-output.outputs.testoutput, 'complete!') - with: - script: | - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: ${{ github.event.number }}, - labels: ["Complete"] - }); - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: ${{ github.event.number }}, - name: "Needs Review" - }); + env: + GH_TOKEN: ${{ secrets.MY_TOKEN }} + ISSUE_URL: ${{ github.event.issue.html_url }} + run: | + gh issue edit $ISSUE_URL --add-label "Complete" + gh issue edit $ISSUE_URL --remove-label "Needs Review" From 3bc86761b7321e7dc6b059b1b93880c9eea0fdb7 Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:38:51 +0100 Subject: [PATCH 17/20] break script 2 to test test --- individual-shell-tools/awk/script-01.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 90e2397d..93fc89e0 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $1}' scores-table.txt +awk '{print $2}' scores-table.txt From 46a2c90503ef680140235ba475dfb8efa1759ef5 Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:41:18 +0100 Subject: [PATCH 18/20] try adding push permisison again --- .github/workflows/test-sdc-tasks.yml | 5 +++++ individual-shell-tools/awk/script-01.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index e8f4d88d..42463c1e 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,6 +1,11 @@ name: Test SDC Tasks on: + push: + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' pull_request_target: paths: - 'individual-shell-tools/**.sh' diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 93fc89e0..90e2397d 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,4 +4,4 @@ set -euo pipefail # TODO: Write a command to output just the names of each player in `scores-table.txt`. # Your output should contain 6 lines, each with just one word on it. -awk '{print $2}' scores-table.txt +awk '{print $1}' scores-table.txt From 166e725cde483ac8d253b5ee9c7c81cd2ce6f172 Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:47:55 +0100 Subject: [PATCH 19/20] allow modifications on all pull requests --- .github/workflows/test-sdc-tasks.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index 42463c1e..a026edfb 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -6,6 +6,16 @@ on: - 'individual-shell-tools/**.sh' - 'shell-pipelines/**.sh' - 'jq/*.sh' + pull_request: + paths: + - 'individual-shell-tools/**.sh' + - 'shell-pipelines/**.sh' + - 'jq/*.sh' + types: + - labeled + - opened + - edited + - reopened pull_request_target: paths: - 'individual-shell-tools/**.sh' From 165767921468145f1b7b0ab60da3cb073bb2cd82 Mon Sep 17 00:00:00 2001 From: l Date: Mon, 30 Mar 2026 12:49:42 +0100 Subject: [PATCH 20/20] use same triggers as validator --- .github/workflows/test-sdc-tasks.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/test-sdc-tasks.yml b/.github/workflows/test-sdc-tasks.yml index a026edfb..30369dea 100644 --- a/.github/workflows/test-sdc-tasks.yml +++ b/.github/workflows/test-sdc-tasks.yml @@ -1,28 +1,10 @@ name: Test SDC Tasks on: - push: - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' - pull_request: - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' - types: - - labeled - - opened - - edited - - reopened pull_request_target: - paths: - - 'individual-shell-tools/**.sh' - - 'shell-pipelines/**.sh' - - 'jq/*.sh' types: - labeled + - unlabeled - opened - edited - reopened