mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
Using original
```
cat file.txt | while read line; do
echo $line
done
```
is problematic, because changing variables inside the loop are lost outside. Example:
```
count=0
cat file.txt | while read line; do
count=$(( count+1 ))
echo $count":"$line
done
echo "total:"$count
```
outputs to
```
total:0
```