Skip to content

Commit

Permalink
differences for PR #259
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 3, 2024
1 parent 83b7d6c commit 3e0032d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 5 additions & 4 deletions 04-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ Alternatively, rather than running the loop above on the command line, you can s

```
#!/bin/bash
# This script loops through .txt files, returns the file name, first line, and last line of the file
# This script loops through .txt files, returns the file name,
# first line, and last line of the file
for file in *.txt
do
echo $file
head -n 1 $file
tail -n 1 $file
echo "$file"
head -n 1 "$file"
tail -n 1 "$file"
done
```

Expand Down
12 changes: 7 additions & 5 deletions files/my_first_bash_script.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash
# This script loops through .txt files, returns the
# file name, first line, and last line of the file

for filename in *.txt
for file in *.txt
do
echo $filename
head -n 5 $filename
tail -n 5 $filename
done
echo "$file"
head -n 1 "$file"
tail -n 1 "$file"
done
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"episodes/01-intro-shell.md" "4248552de8d7fe3f30930e93acef8436" "site/built/01-intro-shell.md" "2023-05-08"
"episodes/02-navigating-the-filesystem.md" "c85f3b8108023b4da52d70fce13f2c43" "site/built/02-navigating-the-filesystem.md" "2024-02-23"
"episodes/03-working-with-files-and-folders.md" "f28760ce8c1c6e3b96c8b6ccacc55772" "site/built/03-working-with-files-and-folders.md" "2024-02-23"
"episodes/04-loops.md" "ef86d9f8b71733dea97b44a886391bdd" "site/built/04-loops.md" "2024-02-23"
"episodes/04-loops.md" "85f66d92cc6fc1a25b0214c0d108f892" "site/built/04-loops.md" "2024-04-03"
"episodes/05-counting-mining.md" "f61fde3e769614d41d8b22e09f38d1e7" "site/built/05-counting-mining.md" "2024-02-23"
"episodes/06-free-text.md" "143b9518631bcf5b114d1f432e5a9c25" "site/built/06-free-text.md" "2023-05-08"
"instructors/instructor-notes.md" "c317e03b34390725b50f49df1bf943b1" "site/built/instructor-notes.md" "2024-02-23"
Expand Down

0 comments on commit 3e0032d

Please sign in to comment.