Add a note about grep being a placeholder; I've referenced this page for looping through pipes and files; years of my code uses this placeholder!!1

jtagcat
2022-05-22 16:35:04 +00:00
parent 82545eca0e
commit 5e65335587

@@ -39,6 +39,15 @@ done < mypipe
rm mypipe
```
NOTE: `grep -v '^ *#'` is a placeholder example and not needed. To just loop through a file:
```sh
while IFS= read -r line
do
echo "Line: $line"
done << file
# or: done <<< "$variable"
```
### Rationale:
For loops by default (subject to `$IFS`) read word by word. Additionally, glob expansion will occur.