I am wondering why
ls -1 |
while read file; do
echo $file; tail -n 100 $file > >(sleep 1 && cat > $file)
done
is faster than
ls -1 |
while read file; do
echo $file; tail -n 100 $file | (sleep 1 && cat > $file)
done
?
If there are 100 files in a directory then:
- the second command takes almost 100 seconds to process
- the first command is processed almost immediately.