Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!sequent!paulr From: paulr@sequent.UUCP (Paul Reger) Newsgroups: comp.unix.questions Subject: printf() with vector arguments. Keywords: printf() Message-ID: <23078@sequent.UUCP> Date: 11 Oct 89 18:02:59 GMT Reply-To: paulr@crg3.UUCP (Paul Reger) Distribution: comp Organization: Sequent Computer Systems, Inc Lines: 36 I was wondering if there exists such a beast as: void vec_printf(char *fmt,void *args[]); (as opposed to what we're all familiar with: void printf(char *fmt, ...);) Such a thing would be useful for a tool that can be used with any shell - call it shell_printf. This would have the synopsis: shell_printf fmt [arg1 [arg2 [arg3 ... [argn]]]] and its purpose would be to format and print out its arguments to stdout in the exact same manner as printf() does. Such a tool would be useful for output in shell scripts. For example: shell_printf "There are %9d dogs, weighing %9g pounds, and my son's name is '%s'.\n\n\n" 100 12.23 Eric which would print out to stdout: `` There are 100 dogs, weighing 12.23 punds, and my son's name is 'Eric'. '' Without the vec_printf() routine, such a tool would be hard to do. paulr (Paul Reger) Sequent Computer Systems, Beaverton Oregon {uunet,ucbvax!rutgers!ogccse}!sequent!paulr -- paulr (Paul Reger) Sequent Computer Systems, Beaverton Oregon {uunet,ucbvax!rutgers!ogccse}!sequent!paulr