Skip to content

Commit 3e0032d

Browse files
committed
differences for PR #259
1 parent 83b7d6c commit 3e0032d

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

04-loops.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,13 @@ Alternatively, rather than running the loop above on the command line, you can s
138138

139139
```
140140
#!/bin/bash
141-
# This script loops through .txt files, returns the file name, first line, and last line of the file
141+
# This script loops through .txt files, returns the file name,
142+
# first line, and last line of the file
142143
for file in *.txt
143144
do
144-
echo $file
145-
head -n 1 $file
146-
tail -n 1 $file
145+
echo "$file"
146+
head -n 1 "$file"
147+
tail -n 1 "$file"
147148
done
148149
```
149150

files/my_first_bash_script.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
2+
# This script loops through .txt files, returns the
3+
# file name, first line, and last line of the file
24

3-
for filename in *.txt
5+
for file in *.txt
46
do
5-
echo $filename
6-
head -n 5 $filename
7-
tail -n 5 $filename
8-
done
7+
echo "$file"
8+
head -n 1 "$file"
9+
tail -n 1 "$file"
10+
done

md5sum.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"episodes/01-intro-shell.md" "4248552de8d7fe3f30930e93acef8436" "site/built/01-intro-shell.md" "2023-05-08"
88
"episodes/02-navigating-the-filesystem.md" "c85f3b8108023b4da52d70fce13f2c43" "site/built/02-navigating-the-filesystem.md" "2024-02-23"
99
"episodes/03-working-with-files-and-folders.md" "f28760ce8c1c6e3b96c8b6ccacc55772" "site/built/03-working-with-files-and-folders.md" "2024-02-23"
10-
"episodes/04-loops.md" "ef86d9f8b71733dea97b44a886391bdd" "site/built/04-loops.md" "2024-02-23"
10+
"episodes/04-loops.md" "85f66d92cc6fc1a25b0214c0d108f892" "site/built/04-loops.md" "2024-04-03"
1111
"episodes/05-counting-mining.md" "f61fde3e769614d41d8b22e09f38d1e7" "site/built/05-counting-mining.md" "2024-02-23"
1212
"episodes/06-free-text.md" "143b9518631bcf5b114d1f432e5a9c25" "site/built/06-free-text.md" "2023-05-08"
1313
"instructors/instructor-notes.md" "c317e03b34390725b50f49df1bf943b1" "site/built/instructor-notes.md" "2024-02-23"

0 commit comments

Comments
 (0)