[Ilugc] Auto e-mail greeter program

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Mon Oct 16 16:51:29 2006

On Mon, Oct 16, 2006 at 12:39:11PM +0200, Binand Sethumadhavan wrote:

On 16/10/06, Girish Venkatachalam <girishvenkatachalam@xxxxxxxxx> wrote:
2. Your aeg script has a race condition; on multiuser systems with
malicious users, this can lead to arbitrary files owned by the user
running AEG to be wiped out. mktemp(1)  is the safe way of creating
temporary files.
Oh yes, I know mktemp but forgot. I could put that change in but I am not 
too particular.

Yep, this is the single biggest argument used against FOSS. The
developer is usually not particular about users' requirements or
security considerations. Developer's response is in most cases, "works
for me". I'd imagine 60% of the patches Redhat includes are about
fixing things like race conditions etc. because the developer could
not be bothered to fix silly bugs like these.
Interesting argument but I actually agree and I have uploaded the new versio 
with all your comments. 

Check out!

Coming to your argument I think you are right.

Open source developers don't actually care much about users or polish to be 
precise but then I find the quality of open source code to be much better since 
they are actually bothered that others are going to see it.

Whereas propreitary code ends up being really ugly, complex and buggy and too 
feature ridden...

So you can use the argument both ways.

I would go for a sensible open source development approach.

And user friendliness should make the user know what he is doing rather than 
treating him as an idiot. That is why I did not put the crontab entry myself. 


That is actually meant to solve the confusion between mm/dd and dd/mm 
formats for dates. You can easily look at an entry and identify.

But you are asking your user to enter the same information twice, in
slightly different formats. Why don't you use one format and convert
to the other if need be? How would you like if a program asked you,
"Enter IP address in x.y.z.t format" and in the next window, asks you
"Enter same IP address as a 32-bit integer"?
Disagree, your case and my example are completely different.

I prefer my way. We in India use dd/mm and the script uses mm/dd.

Can cause a great deal of heartache...

4. All your lines which goes "| cut -d '|' ..." can be replaced far
cleaner with the bash inbuilt command "set".
How? Can you give a code sample? I guess I get what you are saying but 
some prodding will help. :-)

Well, given this $line:

Amma and appa |dad@xxxxxxxxx,mom@xxxxxxxxx|mday|Oct 5|10/05

And this snippet:

declare -x oldifs="$IFS"; declare -x IFS="|"; set -- $line; declare -x
IFS="$oldifs"

You can then have:

appellation="$1"
mailids="$2"
event="$3"
event_date="$5"

and you don't have a single fork/exec combo for external programs in
your script for this (and most of the code above is concerned about
restoring IFS, which you can ignore inside a shell script under
certain conditions).
Ahem, advanced scripting technique. Didn't understand but got the idea. 
Thananks. Shall surely remember in future.

In addition, this messy bit:

       TODAY=`date +%D | cut -d/ -f1-2`
       event_date=`echo ${line} | cut -d'|' -f5 `
       if [ "${TODAY}" = "${event_date}" ];then
               send_email
       fi

is far cleaner if you go as (with event_date coming from your FOURTH
field ("Oct 16"), not the fifth):

if [ `date +%j` -eq `date +%j -d $event_date` ]; then
   send_mail
fi
Looks very interesting and smart but I prefer my way.

For me, an internal representation using digits and slashes without space 
characters are better for data munching than a human readable form which is 
retrofitted to work in programs...

However appreciate your input at the same time.

Thanks.

Guys,

        Please check out the latest bug fixed version!

        I think you should run it! It is very very colorful!

        Even in console, it looks so cool I have hardly seen such a nicely 
written console GUI.

        No, I am not boasting, I am just happy at my setup script.

        However I definitely want to learn ncurses programming and programming 
using the dialog utility..

regards,
Girish

Other related posts: