What I mean is whats supposed to happen is all of the output should go to one text file status. Whats happening is printf is copying one line at a time and creating a new status txt file every time.
Here is the almost completed script.
echo What is the account name?
read account
echo What is the email?
read email
echo How many hours?
read hours
let t=$hours*60
find . ! -name '.*' -type f -mmin "+$t" > holder
cut -c 3-70 holder > uploads
for f in $(<uploads); do s=`echo "$PWD/$f" | sed -e "s/^.*\.fileburst\.com/$account.fileburst.com/"`;z=`ls -la "$f" | awk '{ printf("%10d\n", $5)}'`; x=`ls -la "$f"| awk '{printf("%3s-%2s-%4s", $6, $7, $8)}'`;y=`md5sum "$f"| awk '{print $1}'`;
#echo -e "$s\t\t$z\t$x\t$y"
printf "%-75s%+10s %5s %1s \n" $s $z $x $y > status
##mail -s "The following files have been uploaded to your directory chris2" -c "chris.collins@fuse.net" susant < status
rm -rf uploads
rm -rf holder
done
When it emails status, it is also 1 email 1 line at a time.
Try this one (I didn't test it, so it may be considered as pseudocode, just idea)
echo What is the account name?
read account
echo What is the email?
read email
echo How many hours?
read hours
let t=$hours*60
find . ! -name '.*' -type f -mmin "+$t" > holder
cut -c 3-70 holder > uploads
echo > status
for f in $(<uploads); do s=`echo "$PWD/$f" | sed -e "s/^.*\.fileburst\.com/$account.fileburst.com/"`;z=`ls -la "$f" | awk '{ printf("%10d\n", $5)}'`; x=`ls -la "$f"| awk '{printf("%3s-%2s-%4s", $6, $7, $8)}'`;y=`md5sum "$f"| awk '{print $1}'`;
#echo -e "$s\t\t$z\t$x\t$y"
printf "%-75s%+10s %5s %1s \n" $s $z $x $y >> status
done
mail -s "The following files have been uploaded to your directory chris2" -c "chris.collins@fuse.net" susant < status
rm -rf uploads
rm -rf holder
rm -rf status
1) the format that printf allowed me to have where my output was in columns is messed up when I mail it to an email address. It no longer lines up in columns.
2) The other issue is I am recieving multiple emails with this mail commad, instead of just 1??? I am not sure if this is a printf issue or a mail issue?
Can you copy and paste the output of a mail received into a post so that users can see in what way the output is malformed. (Edit as required to remove personal information, but try to keep the same number of characters)
You will need to include more of your script. There does not appear to be anything in what you have posted thus far to cause the problem.
I found out the mail format was exactly the way I wanted it. My email client was not showing true text. So I had to set it to show the original format. I can't believe I spent 3 days debugging a script and it didn't need it, or at least that part.
at the start of the status file, and it should override the username. If you are unsure of the exact format it should have, just veiw the header of an email you have received and look for that line, and copy its format.