Skip to content

Commit f192448

Browse files
committed
differences for PR #290
1 parent d0f83e6 commit f192448

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

04-loops.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ We have called the variable in this loop `filename` in order to make its purpose
101101
Complete the blanks in the for loop below to print the name, first line, and last line of each text file in the current directory.
102102

103103
```bash
104-
___ file in *.txt
104+
___ filename in *.txt
105105
__
106-
echo "_file"
106+
echo "_filename"
107107
head -n 1 _______
108108
____ __ _ _______
109109
____
@@ -114,11 +114,11 @@ ____
114114
## Solution
115115

116116
```bash
117-
for file in *.txt
117+
for filename in *.txt
118118
do
119-
echo "$file"
120-
head -n 1 "$file"
121-
tail -n 1 "$file"
119+
echo "$filename"
120+
head -n 1 "$filename"
121+
tail -n 1 "$filename"
122122
done
123123
```
124124

@@ -140,11 +140,11 @@ Alternatively, rather than running the loop above on the command line, you can s
140140
#!/bin/bash
141141
# This script loops through .txt files, returns the file name,
142142
# first line, and last line of the file
143-
for file in *.txt
143+
for filename in *.txt
144144
do
145-
echo "$file"
146-
head -n 1 "$file"
147-
tail -n 1 "$file"
145+
echo "$filename"
146+
head -n 1 "$filename"
147+
tail -n 1 "$filename"
148148
done
149149
```
150150

files/my_first_bash_script.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This script loops through .txt files, returns the
33
# file name, first line, and last line of the file
44

5-
for file in *.txt
5+
for filename in *.txt
66
do
7-
echo "$file"
8-
head -n 1 "$file"
9-
tail -n 1 "$file"
7+
echo "$filename"
8+
head -n 1 "$filename"
9+
tail -n 1 "$filename"
1010
done

md5sum.txt

Lines changed: 1 addition & 1 deletion
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" "a55e2785748efba647329295a246802c" "site/built/02-navigating-the-filesystem.md" "2024-05-02"
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" "85f66d92cc6fc1a25b0214c0d108f892" "site/built/04-loops.md" "2025-11-18"
10+
"episodes/04-loops.md" "1f43d5e62ccc59bbe5b9252d127da20f" "site/built/04-loops.md" "2025-11-18"
1111
"episodes/05-counting-mining.md" "8a1409e608d737dc37bb8057e9d6260b" "site/built/05-counting-mining.md" "2025-02-12"
1212
"episodes/06-free-text.md" "0189b30bfbfaaa9ab8e754834500b2f0" "site/built/06-free-text.md" "2024-06-05"
1313
"instructors/instructor-notes.md" "c317e03b34390725b50f49df1bf943b1" "site/built/instructor-notes.md" "2024-02-23"

0 commit comments

Comments
 (0)