#!/bin/bash
FILE=/path/to/file/listing # contains information of directory paths and server it resides. there are 3 different servers
TMPFILE=TEMPF # contains listing of users with most files
SCRIPT=/path/to/script
MAIL=/path/to/mail/message
#TMPDIR=TEMPD
for i in `awk '{print $3}' FILE` # column3 shows directory names
do
# script creates a listing of users with most directories (from most to least) and then output for each iteration into a temporary listing
echo $SCRIPT $i > $TEMPF
# The top two users will be sent a mail. TEMPF will be appended to body of MAIL
done
# next statements not complete
while "${TMPFILE}"/*; do
mailx -s "TEST EMAIL" -r
test@mail.com "${MAIL##*/}" <"${}"
rm -r "${TMPFILE}"
done
I will appreciate your help in piecing together what I'm trying to achieve. I understand the logic of what I am trying to do but cannot translate it properly into scripting code.
Any suggestions will be helpful.
Thanks for the inputs,
Silverhawk