On Tue, Dec 04, 2001 at 02:56:25AM -0600, Scott M. Dier wrote: > On Tue, 2001-12-04 at 02:03, Chad C. Walstrom wrote: > > You know. Command prompts are nice and all... What happens when you > > want to schedule this with cron, though? Just make sure you first write > > Generally, I come up with these sorts of things on the fly in shell or > perl, and then when I need something to be scheduled, I shove it into > cfengine somehow, or write a unattented script to take care of it. I think you missed my point completely. It had nothing to do with scheduling or existing tools. It had more to do with the phrase, "When in Rome..." When you're in a UNIX environment, use that powerful stdin/stdout paradigm that UNIX is so famous for. My point was all about software engineering. * Everything is a filter. (default operation uses stdin/stdout) program < infile > outfile cat infile | program > outfile * Write tools that do one job well. (small, specialized tools) nmh mail for example * Multiple tools chained together complete work... (back to the importance of a filter) # display colorful output of my email bash$ folder +inbox; show 1 | grcat conf.show * The behavior of the program should not change given different input or output targets For an example of what not to emulate, check out the output of ls(1). Type it alone. Pipe it to a pager. Can you tell me what's different? * stdout should be useful to other filters * errors and debugging messages belong in stderr, including the famous "program --help" output. That's what redirection is useful for: program --help 2>&1 | $PAGER * quieter is better, i.e. bash$ cd ~ bash$ # INSTEAD OF bash$ cd ~ Changing to directory /home/chewie bash$ In other words, the first iteration of any program/tool/script should NOT be an interactive one. Interactive scripts or UI's that lead the operator around by the hand are often a detriment if they're designed from the top down. If, on the other hand, UI's are designed around sets of specialized tools, runnable from the command line and useful as filters, you have that powerful UNIX combination that has made so comfortable for us to use. -- Chad Walstrom <chewie at wookimus.net> | a.k.a. ^chewie http://www.wookimus.net/ | s.k.a. gunnarr Get my public key, ICQ#, etc. $(mailx -s 'get info' chewie at wookimus.net) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://shadowknight.real-time.com/pipermail/tclug-list/attachments/20011205/3fb26bec/attachment.pgp