Skip to content

Commit 008325b

Browse files
authored
Add quotes to shell script
- Use consistent syntax - Make it easier to read the example without scrolling
1 parent e30b3aa commit 008325b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

episodes/04-loops.md

Lines changed: 5 additions & 4 deletions
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

0 commit comments

Comments
 (0)