Skip to content

Commit

Permalink
CI run: make.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdoe authored and actions-user committed Jun 15, 2023
1 parent 5f750de commit 696bb83
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions book.md
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,8 @@ Sometimes material incentives are also very helpful, e.g. a promise 5$ gift card

[day-337 unix](#day-337-unix)

[day-338 unix](#day-338-unix)

## [DAY-0] The Computer

All modern computers(laptops, phones, pc master race rgb monsters, etc) have somewhat similar components: Processor, Memory, Video Card, Disk and USB controller, WiFi card etc. Some of them are in one single chip and you cant even see them anymore, but they are there. For example there are chips that have Processor and Video Card together. The term for processor is actually CPU - Central processing unit, but we called it processors when we were kids and it kind of make sense, since it processes stuff.
Expand Down Expand Up @@ -24500,4 +24502,22 @@ f.close()
```


## [DAY-338] unix

Make a program that counts the lines that are exactly 5 characters and start with 'h', use `nano` on the remote computer to edit the program from the previous day.

```
f = open("/etc/hidden/data.txt","r")
lines = f.readlines()
n = 0
for l in lines:
if l.startswith("h"):
n += 1
f.close()
print(n)
```

Now do the same with unix pipes, `cat /etc/hidden/data.txt | grep ^h | wc -l`



8 changes: 8 additions & 0 deletions examples/week-046/007.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
f = open("/etc/hidden/data.txt","r")
lines = f.readlines()
n = 0
for l in lines:
if l.startswith("h"):
n += 1
f.close()
print(n)
2 changes: 2 additions & 0 deletions toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -841,3 +841,5 @@
[day-336 unix](#day-336-unix)

[day-337 unix](#day-337-unix)

[day-338 unix](#day-338-unix)

0 comments on commit 696bb83

Please sign in to comment.