Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!otc!metro!johnr From: johnr@metro.oz (John Andrew Rosauer) Newsgroups: net.sources Subject: shell printf - a sensible solution Message-ID: <377@metro.oz> Date: Sun, 15-Mar-87 23:12:21 EST Article-I.D.: metro.377 Posted: Sun Mar 15 23:12:21 1987 Date-Received: Tue, 17-Mar-87 01:30:58 EST Reply-To: johnr@metro.su.oz (John Andrew Rosauer) Distribution: world Organization: Uni Computing Services, Uni of Sydney. Australia. Lines: 17 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. ########################################################### if [ $# -lt 1 ] then echo >&2 "Usage: printf format [ arg ...]" exit 1 fi x="\"$1\"" shift for i do x="$x,\"$i\"" done awk "BEGIN { printf $x; exit }"