From 6a20de27c8de8b570b17960ad07b40c1e7475ca6 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 4 Mar 2026 16:17:42 +0000 Subject: [PATCH 01/11] exercise ls --- individual-shell-tools/ls/script-01.sh | 1 + individual-shell-tools/ls/script-02.sh | 2 ++ individual-shell-tools/ls/script-03.sh | 2 ++ individual-shell-tools/ls/script-04.sh | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/individual-shell-tools/ls/script-01.sh b/individual-shell-tools/ls/script-01.sh index 241b62f5..0641b0f3 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 \ No newline at end of file diff --git a/individual-shell-tools/ls/script-02.sh b/individual-shell-tools/ls/script-02.sh index d0a5a10f..ea5b3610 100755 --- a/individual-shell-tools/ls/script-02.sh +++ b/individual-shell-tools/ls/script-02.sh @@ -4,3 +4,5 @@ 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 \ No newline at end of file diff --git a/individual-shell-tools/ls/script-03.sh b/individual-shell-tools/ls/script-03.sh index 781216d2..b259fcb1 100755 --- a/individual-shell-tools/ls/script-03.sh +++ b/individual-shell-tools/ls/script-03.sh @@ -5,3 +5,5 @@ 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 \ No newline at end of file diff --git a/individual-shell-tools/ls/script-04.sh b/individual-shell-tools/ls/script-04.sh index 72f3817b..863f05c7 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 -t1 ./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 -t1r ./child-directory \ No newline at end of file From c417e0a06cf4e4a6315806f6fab39d5286533588 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 4 Mar 2026 16:24:25 +0000 Subject: [PATCH 02/11] exercise cat --- individual-shell-tools/cat/script-01.sh | 1 + individual-shell-tools/cat/script-02.sh | 1 + individual-shell-tools/cat/script-03.sh | 1 + individual-shell-tools/cat/script-04-stretch.sh | 1 + 4 files changed, 4 insertions(+) diff --git a/individual-shell-tools/cat/script-01.sh b/individual-shell-tools/cat/script-01.sh index c85053e0..94ceeb4f 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 \ No newline at end of file diff --git a/individual-shell-tools/cat/script-02.sh b/individual-shell-tools/cat/script-02.sh index 01bbd5ea..4a045acf 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/* \ No newline at end of file diff --git a/individual-shell-tools/cat/script-03.sh b/individual-shell-tools/cat/script-03.sh index 37573b0c..e4c6d99f 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 \ No newline at end of file diff --git a/individual-shell-tools/cat/script-04-stretch.sh b/individual-shell-tools/cat/script-04-stretch.sh index 00fe3c48..f71b48fe 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 -n ../helper-files/* \ No newline at end of file From aa9527c8802c6becc6f56e07cbb2313f8f73322c Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 4 Mar 2026 16:35:15 +0000 Subject: [PATCH 03/11] exercise wc --- individual-shell-tools/wc/script-01.sh | 1 + individual-shell-tools/wc/script-02.sh | 1 + individual-shell-tools/wc/script-03.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/individual-shell-tools/wc/script-01.sh b/individual-shell-tools/wc/script-01.sh index c9dd6e5d..2b1e87d6 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 \ No newline at end of file diff --git a/individual-shell-tools/wc/script-02.sh b/individual-shell-tools/wc/script-02.sh index 8feeb1a6..5520379b 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 \ No newline at end of file diff --git a/individual-shell-tools/wc/script-03.sh b/individual-shell-tools/wc/script-03.sh index 6b2e9d3d..1004244a 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/helper-*.txt \ No newline at end of file From 8a046bdfcce7dbad3ba9d60a622bc7015c3dbe16 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 4 Mar 2026 22:47:32 +0000 Subject: [PATCH 04/11] exercise grep --- 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 + 7 files changed, 7 insertions(+) diff --git a/individual-shell-tools/grep/script-01.sh b/individual-shell-tools/grep/script-01.sh index fb05f42f..86a7a3bf 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 "" dialogue.txt \ No newline at end of file diff --git a/individual-shell-tools/grep/script-02.sh b/individual-shell-tools/grep/script-02.sh index df6f8564..eb861e1f 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 \ No newline at end of file diff --git a/individual-shell-tools/grep/script-03.sh b/individual-shell-tools/grep/script-03.sh index 5383fe57..7e0a7e03 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 -i "doctor" dialogue.txt | wc -l \ No newline at end of file diff --git a/individual-shell-tools/grep/script-04.sh b/individual-shell-tools/grep/script-04.sh index 80ee0477..f66a2584 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 -iv "hello" dialogue.txt \ No newline at end of file diff --git a/individual-shell-tools/grep/script-05.sh b/individual-shell-tools/grep/script-05.sh index 1eb53818..32faabfa 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..b20d6564 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 \ No newline at end of file diff --git a/individual-shell-tools/grep/script-07.sh b/individual-shell-tools/grep/script-07.sh index 9670ebad..e35ac051 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 \ No newline at end of file From f741beacd398933992e5c5b1111af9437e8329ec Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Sun, 8 Mar 2026 16:59:27 +0000 Subject: [PATCH 05/11] sed exercise --- individual-shell-tools/sed/script-01.sh | 2 ++ individual-shell-tools/sed/script-02.sh | 2 ++ individual-shell-tools/sed/script-03.sh | 2 ++ individual-shell-tools/sed/script-04.sh | 2 ++ individual-shell-tools/sed/script-05.sh | 2 ++ individual-shell-tools/sed/script-06.sh | 2 ++ 6 files changed, 12 insertions(+) diff --git a/individual-shell-tools/sed/script-01.sh b/individual-shell-tools/sed/script-01.sh index 3eba6fa4..174da5fb 100755 --- a/individual-shell-tools/sed/script-01.sh +++ b/individual-shell-tools/sed/script-01.sh @@ -5,3 +5,5 @@ 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 "s/i/I/g" input.txt \ No newline at end of file diff --git a/individual-shell-tools/sed/script-02.sh b/individual-shell-tools/sed/script-02.sh index abdd64d0..4adff385 100755 --- a/individual-shell-tools/sed/script-02.sh +++ b/individual-shell-tools/sed/script-02.sh @@ -5,3 +5,5 @@ 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 \ No newline at end of file diff --git a/individual-shell-tools/sed/script-03.sh b/individual-shell-tools/sed/script-03.sh index dd284a29..be179fa9 100755 --- a/individual-shell-tools/sed/script-03.sh +++ b/individual-shell-tools/sed/script-03.sh @@ -4,3 +4,5 @@ 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 "/[0-9]/d" input.txt \ No newline at end of file diff --git a/individual-shell-tools/sed/script-04.sh b/individual-shell-tools/sed/script-04.sh index 0052ac6c..ae19f673 100755 --- a/individual-shell-tools/sed/script-04.sh +++ b/individual-shell-tools/sed/script-04.sh @@ -4,3 +4,5 @@ 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 "s/We'll/We will/g" input.txt \ No newline at end of file diff --git a/individual-shell-tools/sed/script-05.sh b/individual-shell-tools/sed/script-05.sh index 2dcc91a0..3a7ba017 100755 --- a/individual-shell-tools/sed/script-05.sh +++ b/individual-shell-tools/sed/script-05.sh @@ -6,3 +6,5 @@ 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 's/^\([0-9]\+\) \(.*\)$/\2 \1/' input.txt \ No newline at end of file diff --git a/individual-shell-tools/sed/script-06.sh b/individual-shell-tools/sed/script-06.sh index 0b939017..aea80bc1 100755 --- a/individual-shell-tools/sed/script-06.sh +++ b/individual-shell-tools/sed/script-06.sh @@ -8,3 +8,5 @@ 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 's/,\([^ ]\)/, \1/g' input.txt \ No newline at end of file From 8cd1dcc4644ba5935c9ffd6ec04414f50ad36e99 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Sun, 8 Mar 2026 17:26:49 +0000 Subject: [PATCH 06/11] awk exercise --- individual-shell-tools/awk/script-01.sh | 2 ++ individual-shell-tools/awk/script-02.sh | 2 ++ individual-shell-tools/awk/script-03.sh | 2 ++ individual-shell-tools/awk/script-04.sh | 2 ++ individual-shell-tools/awk/script-05.sh | 2 ++ 5 files changed, 10 insertions(+) diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 8db4390a..587ed2ac 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -4,3 +4,5 @@ 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 \ No newline at end of file diff --git a/individual-shell-tools/awk/script-02.sh b/individual-shell-tools/awk/script-02.sh index 5956be9b..98fcf857 100755 --- a/individual-shell-tools/awk/script-02.sh +++ b/individual-shell-tools/awk/script-02.sh @@ -4,3 +4,5 @@ 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 \ No newline at end of file diff --git a/individual-shell-tools/awk/script-03.sh b/individual-shell-tools/awk/script-03.sh index af7c6e8b..65452c52 100755 --- a/individual-shell-tools/awk/script-03.sh +++ b/individual-shell-tools/awk/script-03.sh @@ -5,3 +5,5 @@ 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 '{print $1 " " $3}' scores-table.txt \ No newline at end of file diff --git a/individual-shell-tools/awk/script-04.sh b/individual-shell-tools/awk/script-04.sh index bf15703c..12d2005a 100755 --- a/individual-shell-tools/awk/script-04.sh +++ b/individual-shell-tools/awk/script-04.sh @@ -5,3 +5,5 @@ 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" {print $1, $NF}' scores-table.txt \ No newline at end of file diff --git a/individual-shell-tools/awk/script-05.sh b/individual-shell-tools/awk/script-05.sh index d1680cb0..84435739 100755 --- a/individual-shell-tools/awk/script-05.sh +++ b/individual-shell-tools/awk/script-05.sh @@ -5,3 +5,5 @@ 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 '{print $1, NF-2}' scores-table.txt From c104cd4a1f42200b4c270873ba5b58d6f35d645a Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Tue, 10 Mar 2026 23:05:33 +0000 Subject: [PATCH 07/11] number-systems exercise -- not complete --- number-systems/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/number-systems/README.md b/number-systems/README.md index 77a3bde9..26aaad5a 100644 --- a/number-systems/README.md +++ b/number-systems/README.md @@ -5,34 +5,34 @@ 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: 110 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: 1111 How many bits would you need in order to store the numbers between 0 and 255 inclusive? Answer: 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 How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)? Answer: From 5cae9522947cd2ab4add71b77a5636eb377883fa Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 25 Mar 2026 21:09:39 +0000 Subject: [PATCH 08/11] added new line at the end of each file --- individual-shell-tools/awk/script-01.sh | 2 +- individual-shell-tools/awk/script-02.sh | 2 +- individual-shell-tools/awk/script-03.sh | 2 +- individual-shell-tools/awk/script-04.sh | 3 ++- individual-shell-tools/cat/script-01.sh | 2 +- individual-shell-tools/cat/script-02.sh | 2 +- individual-shell-tools/cat/script-03.sh | 2 +- individual-shell-tools/cat/script-04-stretch.sh | 2 +- individual-shell-tools/grep/script-01.sh | 2 +- individual-shell-tools/grep/script-02.sh | 2 +- individual-shell-tools/grep/script-03.sh | 2 +- individual-shell-tools/grep/script-04.sh | 2 +- individual-shell-tools/grep/script-06.sh | 2 +- individual-shell-tools/grep/script-07.sh | 2 +- individual-shell-tools/ls/script-01.sh | 2 +- individual-shell-tools/ls/script-02.sh | 2 +- individual-shell-tools/ls/script-03.sh | 2 +- individual-shell-tools/ls/script-04.sh | 2 +- individual-shell-tools/sed/script-01.sh | 2 +- individual-shell-tools/sed/script-02.sh | 2 +- individual-shell-tools/sed/script-03.sh | 2 +- individual-shell-tools/sed/script-04.sh | 2 +- individual-shell-tools/sed/script-05.sh | 2 +- individual-shell-tools/sed/script-06.sh | 2 +- individual-shell-tools/wc/script-01.sh | 2 +- individual-shell-tools/wc/script-02.sh | 2 +- individual-shell-tools/wc/script-03.sh | 2 +- 27 files changed, 28 insertions(+), 27 deletions(-) diff --git a/individual-shell-tools/awk/script-01.sh b/individual-shell-tools/awk/script-01.sh index 587ed2ac..e75a263c 100755 --- a/individual-shell-tools/awk/script-01.sh +++ b/individual-shell-tools/awk/script-01.sh @@ -5,4 +5,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 \ No newline at end of file +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 98fcf857..1984a14d 100755 --- a/individual-shell-tools/awk/script-02.sh +++ b/individual-shell-tools/awk/script-02.sh @@ -5,4 +5,4 @@ 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 \ No newline at end of file +awk '{print $1 " " $2}' scores-table.txt diff --git a/individual-shell-tools/awk/script-03.sh b/individual-shell-tools/awk/script-03.sh index 65452c52..49079f61 100755 --- a/individual-shell-tools/awk/script-03.sh +++ b/individual-shell-tools/awk/script-03.sh @@ -6,4 +6,4 @@ set -euo pipefail # Your output should contain 6 lines, each with one word and one number on it. # The first line should be "Ahmed 1". -awk '{print $1 " " $3}' scores-table.txt \ No newline at end of file +awk '{print $1 " " $3}' scores-table.txt diff --git a/individual-shell-tools/awk/script-04.sh b/individual-shell-tools/awk/script-04.sh index 12d2005a..a658d928 100755 --- a/individual-shell-tools/awk/script-04.sh +++ b/individual-shell-tools/awk/script-04.sh @@ -6,4 +6,5 @@ set -euo pipefail # 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" {print $1, $NF}' scores-table.txt \ No newline at end of file +awk '$2=="London" {print $1, $NF}' scores-table.txt + diff --git a/individual-shell-tools/cat/script-01.sh b/individual-shell-tools/cat/script-01.sh index 94ceeb4f..edcc54fb 100755 --- a/individual-shell-tools/cat/script-01.sh +++ b/individual-shell-tools/cat/script-01.sh @@ -4,4 +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 \ No newline at end of file +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 4a045acf..d8187ff4 100755 --- a/individual-shell-tools/cat/script-02.sh +++ b/individual-shell-tools/cat/script-02.sh @@ -11,4 +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/* \ No newline at end of file +cat ../helper-files/* diff --git a/individual-shell-tools/cat/script-03.sh b/individual-shell-tools/cat/script-03.sh index e4c6d99f..dd6b1d8b 100755 --- a/individual-shell-tools/cat/script-03.sh +++ b/individual-shell-tools/cat/script-03.sh @@ -9,4 +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 \ No newline at end of file +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 f71b48fe..a8c0c030 100755 --- a/individual-shell-tools/cat/script-04-stretch.sh +++ b/individual-shell-tools/cat/script-04-stretch.sh @@ -13,4 +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 -n ../helper-files/* \ No newline at end of file +cat -n ../helper-files/* diff --git a/individual-shell-tools/grep/script-01.sh b/individual-shell-tools/grep/script-01.sh index 86a7a3bf..bfe2132b 100755 --- a/individual-shell-tools/grep/script-01.sh +++ b/individual-shell-tools/grep/script-01.sh @@ -4,4 +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 "" dialogue.txt \ No newline at end of file +grep "" dialogue.txt diff --git a/individual-shell-tools/grep/script-02.sh b/individual-shell-tools/grep/script-02.sh index eb861e1f..31d35703 100755 --- a/individual-shell-tools/grep/script-02.sh +++ b/individual-shell-tools/grep/script-02.sh @@ -4,4 +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 \ No newline at end of file +grep -i "doctor" dialogue.txt diff --git a/individual-shell-tools/grep/script-03.sh b/individual-shell-tools/grep/script-03.sh index 7e0a7e03..00737fb2 100755 --- a/individual-shell-tools/grep/script-03.sh +++ b/individual-shell-tools/grep/script-03.sh @@ -4,4 +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 -i "doctor" dialogue.txt | wc -l \ No newline at end of file +grep -i "doctor" dialogue.txt | wc -l diff --git a/individual-shell-tools/grep/script-04.sh b/individual-shell-tools/grep/script-04.sh index f66a2584..14a2a131 100755 --- a/individual-shell-tools/grep/script-04.sh +++ b/individual-shell-tools/grep/script-04.sh @@ -4,4 +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 -iv "hello" dialogue.txt \ No newline at end of file +grep -iv "hello" dialogue.txt diff --git a/individual-shell-tools/grep/script-06.sh b/individual-shell-tools/grep/script-06.sh index b20d6564..0e8244ff 100755 --- a/individual-shell-tools/grep/script-06.sh +++ b/individual-shell-tools/grep/script-06.sh @@ -4,4 +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 \ No newline at end of file +grep -l "^Doctor:" *.txt diff --git a/individual-shell-tools/grep/script-07.sh b/individual-shell-tools/grep/script-07.sh index e35ac051..137cf471 100755 --- a/individual-shell-tools/grep/script-07.sh +++ b/individual-shell-tools/grep/script-07.sh @@ -4,4 +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 \ No newline at end of file +grep -c "^doctor:" *.txt diff --git a/individual-shell-tools/ls/script-01.sh b/individual-shell-tools/ls/script-01.sh index 0641b0f3..c9cd189b 100755 --- a/individual-shell-tools/ls/script-01.sh +++ b/individual-shell-tools/ls/script-01.sh @@ -13,4 +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 \ No newline at end of file +ls diff --git a/individual-shell-tools/ls/script-02.sh b/individual-shell-tools/ls/script-02.sh index ea5b3610..c228f998 100755 --- a/individual-shell-tools/ls/script-02.sh +++ b/individual-shell-tools/ls/script-02.sh @@ -5,4 +5,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 \ No newline at end of file +ls ./child-directory diff --git a/individual-shell-tools/ls/script-03.sh b/individual-shell-tools/ls/script-03.sh index b259fcb1..f11a173a 100755 --- a/individual-shell-tools/ls/script-03.sh +++ b/individual-shell-tools/ls/script-03.sh @@ -6,4 +6,4 @@ set -euo pipefail # 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 \ No newline at end of file +ls -R diff --git a/individual-shell-tools/ls/script-04.sh b/individual-shell-tools/ls/script-04.sh index 863f05c7..846fa539 100755 --- a/individual-shell-tools/ls/script-04.sh +++ b/individual-shell-tools/ls/script-04.sh @@ -21,4 +21,4 @@ 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 -t1r ./child-directory \ No newline at end of file +ls -t1r ./child-directory diff --git a/individual-shell-tools/sed/script-01.sh b/individual-shell-tools/sed/script-01.sh index 174da5fb..11cf2542 100755 --- a/individual-shell-tools/sed/script-01.sh +++ b/individual-shell-tools/sed/script-01.sh @@ -6,4 +6,4 @@ set -euo pipefail # The output should contain 11 lines. # The first line of the output should be: "ThIs Is a sample fIle for experImentIng with sed.". -sed "s/i/I/g" input.txt \ No newline at end of file +sed "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 4adff385..b6eb67d9 100755 --- a/individual-shell-tools/sed/script-02.sh +++ b/individual-shell-tools/sed/script-02.sh @@ -6,4 +6,4 @@ set -euo pipefail # The output should contain 11 lines. # Line 6 of the output should be " Alisha". -sed "s/[0-9]//g" input.txt \ No newline at end of file +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 be179fa9..993ecae5 100755 --- a/individual-shell-tools/sed/script-03.sh +++ b/individual-shell-tools/sed/script-03.sh @@ -5,4 +5,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 "/[0-9]/d" input.txt \ No newline at end of file +sed "/[0-9]/d" input.txt diff --git a/individual-shell-tools/sed/script-04.sh b/individual-shell-tools/sed/script-04.sh index ae19f673..8ac6e7c5 100755 --- a/individual-shell-tools/sed/script-04.sh +++ b/individual-shell-tools/sed/script-04.sh @@ -5,4 +5,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 "s/We'll/We will/g" input.txt \ No newline at end of file +sed "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 3a7ba017..4e2be191 100755 --- a/individual-shell-tools/sed/script-05.sh +++ b/individual-shell-tools/sed/script-05.sh @@ -7,4 +7,4 @@ set -euo pipefail # So line 6 which currently reads "37 Alisha" should instead read "Alisha 37". # The output should contain 11 lines. -sed 's/^\([0-9]\+\) \(.*\)$/\2 \1/' input.txt \ No newline at end of file +sed '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 aea80bc1..17ea86f4 100755 --- a/individual-shell-tools/sed/script-06.sh +++ b/individual-shell-tools/sed/script-06.sh @@ -9,4 +9,4 @@ set -euo pipefail # 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 's/,\([^ ]\)/, \1/g' input.txt \ No newline at end of file +sed 's/,\([^ ]\)/, \1/g' input.txt diff --git a/individual-shell-tools/wc/script-01.sh b/individual-shell-tools/wc/script-01.sh index 2b1e87d6..c944eeaf 100755 --- a/individual-shell-tools/wc/script-01.sh +++ b/individual-shell-tools/wc/script-01.sh @@ -4,4 +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 \ No newline at end of file +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 5520379b..16e53091 100755 --- a/individual-shell-tools/wc/script-02.sh +++ b/individual-shell-tools/wc/script-02.sh @@ -4,4 +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 \ No newline at end of file +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 1004244a..ad4a9aea 100755 --- a/individual-shell-tools/wc/script-03.sh +++ b/individual-shell-tools/wc/script-03.sh @@ -8,4 +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/helper-*.txt \ No newline at end of file +wc ../helper-files/helper-*.txt From 500f8105832baf1090b6b797c8fa9824900bf92b Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 25 Mar 2026 21:41:37 +0000 Subject: [PATCH 09/11] updated script1 and script7 --- individual-shell-tools/grep/script-01.sh | 2 +- individual-shell-tools/grep/script-07.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/individual-shell-tools/grep/script-01.sh b/individual-shell-tools/grep/script-01.sh index bfe2132b..bbb24be0 100755 --- a/individual-shell-tools/grep/script-01.sh +++ b/individual-shell-tools/grep/script-01.sh @@ -4,4 +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 "" dialogue.txt +grep "^Doctor" dialogue.txt diff --git a/individual-shell-tools/grep/script-07.sh b/individual-shell-tools/grep/script-07.sh index 137cf471..9fabc87f 100755 --- a/individual-shell-tools/grep/script-07.sh +++ b/individual-shell-tools/grep/script-07.sh @@ -4,4 +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 +grep -c "^Doctor:" *.txt From 4856862d8bcbf82586a390da50ac3b1beebe2e89 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 25 Mar 2026 21:46:38 +0000 Subject: [PATCH 10/11] updated script5 --- individual-shell-tools/grep/script-05.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/individual-shell-tools/grep/script-05.sh b/individual-shell-tools/grep/script-05.sh index 32faabfa..8754273d 100755 --- a/individual-shell-tools/grep/script-05.sh +++ b/individual-shell-tools/grep/script-05.sh @@ -4,4 +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 +grep -B1 "cure" dialogue.txt From 53622a5afaf087eed51928866ce91d6920fb74d4 Mon Sep 17 00:00:00 2001 From: Mohammed Abdoon Date: Wed, 25 Mar 2026 22:05:45 +0000 Subject: [PATCH 11/11] Revert "number-systems exercise -- not complete" This reverts commit c104cd4a1f42200b4c270873ba5b58d6f35d645a. --- number-systems/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/number-systems/README.md b/number-systems/README.md index 26aaad5a..77a3bde9 100644 --- a/number-systems/README.md +++ b/number-systems/README.md @@ -5,34 +5,34 @@ 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: 110 +Answer: Convert the binary number 101101 to decimal: -Answer: 45 +Answer: Which is larger: 1000 or 0111? -Answer: 1000 +Answer: Which is larger: 00100 or 01011? -Answer: 01011 +Answer: What is 10101 + 01010? -Answer: 11111 +Answer: What is 10001 + 10001? -Answer: 100010 +Answer: What's the largest number you can store with 4 bits, if you want to be able to represent the number 0? -Answer: 1111 +Answer: How many bits would you need in order to store the numbers between 0 and 255 inclusive? Answer: How many bits would you need in order to store the numbers between 0 and 3 inclusive? -Answer: 2 +Answer: How many bits would you need in order to store the numbers between 0 and 1000 inclusive? -Answer: 10 +Answer: How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)? Answer: