script to scroll through text and assign each line to a variable

0

I'm trying to make a script that runs up to 15mb of files in a directory and then attach them as files to mutt, the part of selecting the 15mb is done more or less, but I get stuck when it comes to attaching them all together in a single mail with mutt, until here I have arrived:

#!/bin/bash
# envio de email automatico con adjuntos
### para trabajar con espacios
IFS='
'
DIR1=/dir/a/tus/adjuntos
rm /tmp/envio.csv

for i in $( find "$DIR1" -type f);do
TAM1=$(du -b "$i" | cut -f 1)
TAM=$(("$TAM"+"$TAM1"))
if [[ $TAM -lt 15000000 ]];then

echo "$i"
echo "$i" >> /tmp/envio.csv
echo "$TAM1"
echo "$TAM"
fi
done
# hasta aqui todo bien, en envio.csv tengo las rutas de los adjuntos
# lo de mas abajo simplemente no funciona

NF=$(grep -c ".mp4" "/tmp/envio.csv")
echo "$NF"
for (( t=1; t<(($NF+1)); t=t+1 ));do
FILE"$t"="$(grep -m"$t" ".mp4" "/tmp/envio.csv" | tail -n 1)"
#echo "$FILE"$t""
done
    
asked by pacoportables 31.08.2018 в 18:33
source

0 answers