Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!dm@bfly-vax.bbn.com From: dm@bfly-vax.bbn.com Newsgroups: net.sources Subject: Re: shell printf - a sensible solution Message-ID: <5008@brl-adm.ARPA> Date: Tue, 17-Mar-87 20:17:06 EST Article-I.D.: brl-adm.5008 Posted: Tue Mar 17 20:17:06 1987 Date-Received: Thu, 19-Mar-87 01:43:14 EST Sender: news@brl-adm.ARPA Lines: 20 John Andrew Rosauer , writes: >Below is a shell printf NOT written in C. >People should spend a few minutes thinking to see if something can be >done using available utilities rather than immediately writing >thousands of lines of C. It's wasting someone's money. > (shell file that uses awk) Having spent that time thinking, one should realize that, like echo, printf should be faster than starting up awk. To do otherwise is wasting someone's time. Look, ``the UNIX philosophy'' does NOT mean bending existing utilities to do poorly what a simple C program can do well. It is perfectly fine to prototype the function one wants using the suite of tools that UNIX comes packaged with. However, once you've done that prototype, if you're going to make extensive use of it, translating a shell-file into C is a perfectly acceptable optimization.