Skip to content

Commit

Permalink
Ensure script matches main text
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmgit authored Apr 3, 2024
1 parent 008325b commit b1bfb02
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions episodes/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

0 comments on commit b1bfb02

Please sign in to comment.