Birmingham | 2026-MAR-SDC | Joy Opachavalit | Sprint 1 | Individual Shell Tools#338
Birmingham | 2026-MAR-SDC | Joy Opachavalit | Sprint 1 | Individual Shell Tools#338enjoy15 wants to merge 7 commits intoCodeYourFuture:mainfrom
Conversation
SlideGauge
left a comment
There was a problem hiding this comment.
Overall decent work, one small note from me about -lwc and also could you add new lines in the end of files?
| # 1 7 39 ../helper-files/helper-2.txt | ||
| # 3 19 92 ../helper-files/helper-3.txt | ||
| # 5 30 151 total | ||
| wc -lwc ../helper-files/*.txt No newline at end of file |
There was a problem hiding this comment.
What will happen with character count if encoding of our file is non ascii (in ascii each byte equals to a character), but, for example, UTF-8 with exotic characters?
There was a problem hiding this comment.
When a file uses non-ASCII encoding like UTF-8, the relationship between bytes and characters changes:
ASCII: Each character = 1 byte.
UTF-8: Characters use 1-4 bytes. Common characters (e.g., A) use 1 byte, while exotic ones (e.g., 😊) use more.
Impact:
wc -m: Counts characters.
wc -c: Counts bytes (larger for multi-byte characters).
Example:
Hello 😊 → 9 bytes (5 for Hello, 4 for 😊), 6 characters.
| # 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 '{sum = 0; for (i = 3; i <= NF; i++) sum += $i; print $1, sum}' scores-table.txt No newline at end of file |
There was a problem hiding this comment.
Correct choice to start from 3, like!
Learners, PR Template
Self checklist
Changelist
Completed all exercises