Im new to forum so please dont be hard to me if I make any mistakes
I want to the following task:
I have a file lets say file1, which contains job names with numbers which have failed to start and ....
I can sort that file into another to get only the Job numbers with awk
the file1 looks like this
>cat file1
O575757.*
O262628.*
I want to send also the whole log from the jobs that have failed in a attachement in a mail.
want do to something like
for i in `ls /log_path/date/ | !!! need to specify the grep so that i will give output of those files with the names from file1`
then goes
do
uuencode $i $i
done | mailx -s "Files" mymail@company.com
!!! Point is I dont know how to apply the pattern for ls do echo only the that match from the file1
#!/usr/bin/ksh
set -x
homedir='/home/martin/test'
datum='2009.01.27'
while read file
do
for i in ${homedir}/${datum}/${file}
do
(uuencode "$i" "$i" ) | mailx -s "subory" martin@localhost
done
done < ${homedir}/file1