Estou tentando executar este script:
#!/bin/bash
for file in /home/dima/Downloads/dir/*
do
if [ -f "$file" ]
then
echo "SSS::################====================#####################" >> allfiles.txt
cat $file >> allfiles.txt
echo "################====================#####################" >> allfiles.txt
fi
done
Funciona, mas as strings que ecoam impressas só podem ser vistas no final do arquivo quando eu precisar delas entre as saídas de "cat". Como consertar isso?