4 ms·
How does defining `IFS` here make the second statement more efficient than the first? ``` # Inefficient while read -r line; do echo "$line" done < file.tx
by ttGpN5Nde3pK 2y ago
How does defining `IFS` here make the second statement more efficient than the first?
```
# Inefficient
while read -r line; do
echo "$line"
done < file.txt
# Efficient
while IFS= read -r line; do
echo "$line"
done < file.txt
```
https://omid.dev/2024/06/19/advanced-shell-scripting-techniques-automating-complex-tasks-with-bash/#efficient-file-operations https://omid.dev/2024/06/19/advanced-shell-scripting-techniq...
- ttGpN5Nde3pK 2y agoToo late to edit, but serious question if anyone actually knows.