Help Me Please!! Script to email users from a list of directories they own
Hello,
I am sort of a newbie in scripting. I would like some tips and maybe a starting template for a script I can use in sending emails (read from a file) a message to multiple users based off another list I generated. This list has directories owned by the users and their usernames. What would be the best conditional statements to use? Thanks |
Quote:
Post what you've written/tried and tell us where you're stuck. Otherwise, there are MANY script templates/tutorials/sample code you can find easily. My posting signature has one, and the bash scripting tutorials on TLDP are excellent. |
#!/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 |
Code:
while "${TMPFILE}"/*; do Please read this topic: What information to include in a post and how to use code tags |
All times are GMT -5. The time now is 01:12 PM. |