Click to See Complete Forum and Search --> : Very frustrated new BASH programmer


Shannen
06-13-2002, 11:18 AM
I am trying to come up with a birthday program in BASH, that would look into a file with the setup loginname:realname:birthdate and send an email to relevant users at 9:00 am every day. I don't want to use cron. Any ideas?

I'm also trying to write a script that would tell me the number of times I have logged on before now. Would I use the long who am I? finger utility?

Also I am trying to take a directory name as an argument and search that directory for zero length files. Write those files to standard output and then delete the file. So far I have:
find./-size0c -print | less
rm -i $(-find./-size 0c-print)
Am I going in the right direction? :eek: :confused:

scanez
06-13-2002, 01:59 PM
Please do not crosspost. It just makes it difficult for us to give answers and for you to read them. Thank you :)

Strogian
06-13-2002, 06:38 PM
About your first program, why on earth would you not want to use cron? That's basically exactly the reason cron was invented. Unless you manually run the script at 9:00 every day, it's going to take quite a bit of useless code to get a bash script to do that.

For the second program, there's a program that will tell you that, I think. Well, I think there's a better way, but the only thing I found in the past 5 minutes is the 'last' command. So, you could run 'last someuser', and it would print out one line for every time someuser logged in. Then you just count the lines and that's it.