Scripting in C - need help
I am trying to write up a script in C that, when run, e-mails me a message in banner format only if Friday is the 13th of the month. Please help!
|
If you have a specific need to do it in C, then fair enough, but this is a one-liner in cron, assuming sendmail/postfix/whatever is configured:
crontab: 0 9 13 * 5 /usr/bin/banner "Good luck" | /bin/mail -s "Friday" hifivoyager@emailprovider.com Dave |
Is there some reason to guess this thread is anything other than a "do my homework for me" request?
Assuming the thread is homework, hopefully those who know the answer will limit their responses to specific detail answers in response to more specific follow up questions from the OP (don't show off your C knowledge by posting the whole answer). |
C is not a scripting language....Please give some context for the question and confirm if it is homework.
|
Quote:
There are functions available to run another program, providing command line arguments and stdin to that program while capturing the exit code, stdout and stderr from that program. That plus some ordinary programming capabilities makes a scripting language. (I'm not making any comment there on whether it is a convenient scripting language). Quote:
|
Quote:
|
OK---I stand corrected.
You can also put in wood screws with a sledgehammer, but noone would look at a sledgehammer and call it a screwdriver......;) We can use the old definition of money: "Money" is anything that fulfills the function of money. |
Quote:
There is a correct tool for every job, but I can't find it so I'm using a vise grip. I have, in fact, used a vise grip to put in wood screws (it does a much better job than a sledgehammer) as well as take out a wider variety of screws, cut things, take corks out of wine bottles, etc. C or C++ can fill that role very well in software engineering. But in this thread, I was just trying to allow for the possibility that the OP's hypothetical instructor had given a reasonable assignment (do something in C as part of learning C, that might be better done some other way, but teaching something you ought to learn when learning C). |
You only ever need 2 tools:
1. If it moves, but is not supposed to: Duct Tape 2. If it supposed to move, but doesn't: WD-40 |
Nope...
Quote:
|
All times are GMT -5. The time now is 03:13 PM. |