Files
reference/source
oheil 19b09f6500 Update bash.md
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
```
2025-07-12 12:07:57 +02:00
..
2025-07-12 12:07:57 +02:00
2022-11-16 14:10:09 +08:00
2024-05-16 14:37:28 -07:00
2024-05-16 14:37:28 -07:00
2025-07-03 08:39:36 +02:00
2023-06-15 10:44:51 +08:00