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 241b62f5e..0641b0f3f 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 d0a5a10f4..ea5b36107 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 781216d21..b259fcb1d 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 72f3817b3..863f05c7f 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 c85053e0f..94ceeb4fe 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 01bbd5eab..4a045acf0 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 37573b0c1..e4c6d99f6 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 00fe3c48b..f71b48fe7 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 c9dd6e5df..2b1e87d63 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 8feeb1a62..5520379b9 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 6b2e9d3d1..1004244ae 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 fb05f42f2..86a7a3bf0 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 df6f85640..eb861e1fc 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 5383fe578..7e0a7e03d 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 80ee04776..f66a25846 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 1eb538185..32faabfa9 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 5670e3b6c..b20d6564a 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 9670ebad9..e35ac0518 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 3eba6fa4d..174da5fbb 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 abdd64d06..4adff385d 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 dd284a296..be179fa9e 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 0052ac6c4..ae19f6735 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 2dcc91a0c..3a7ba017a 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 0b9390170..aea80bc11 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 8db4390af..587ed2acb 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 5956be9bd..98fcf8576 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 af7c6e8b9..65452c529 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 bf15703c7..12d2005ac 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 d1680cb02..844357398 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 77a3bde94..26aaad5af 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 587ed2acb..e75a263cf 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 98fcf8576..1984a14dd 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 65452c529..49079f61b 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 12d2005ac..a658d928d 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 94ceeb4fe..edcc54fb4 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 4a045acf0..d8187ff42 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 e4c6d99f6..dd6b1d8b1 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 f71b48fe7..a8c0c0308 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 86a7a3bf0..bfe2132b4 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 eb861e1fc..31d357030 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 7e0a7e03d..00737fb24 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 f66a25846..14a2a1316 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 b20d6564a..0e8244ff7 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 e35ac0518..137cf4715 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 0641b0f3f..c9cd189b5 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 ea5b36107..c228f9989 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 b259fcb1d..f11a173a4 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 863f05c7f..846fa5391 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 174da5fbb..11cf25421 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 4adff385d..b6eb67d9d 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 be179fa9e..993ecae5c 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 ae19f6735..8ac6e7c5d 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 3a7ba017a..4e2be1913 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 aea80bc11..17ea86f45 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 2b1e87d63..c944eeafe 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 5520379b9..16e530918 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 1004244ae..ad4a9aea8 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 bfe2132b4..bbb24be02 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 137cf4715..9fabc87f0 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 32faabfa9..8754273d3 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 26aaad5af..77a3bde94 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: