Skip to content

Commit

Permalink
nit: add some examples and file templates
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 7, 2023
1 parent f602f5a commit f3c1df2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/examples/read-line-by-line.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# https://linuxhandbook.com/bash-read-line-by-line/

file="input-file.txt"

while read -r line; do
echo -e "$line\n"
done <$file

# OR

cat LHB.txt | while IFS= read -r line; do
echo "$line"
echo # Print a blank line
done

0 comments on commit f3c1df2

Please sign in to comment.