Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!ncsuvx!mcnc!duke!juliet!khera From: khera@juliet.cs.duke.edu (Vick Khera) Newsgroups: comp.unix.questions Subject: Re: printf() with vector arguments. Keywords: printf() Message-ID: <15777@duke.cs.duke.edu> Date: 13 Oct 89 16:50:19 GMT References: <23078@sequent.UUCP> Sender: news@duke.cs.duke.edu Reply-To: khera@cs.duke.edu (Vick Khera) Distribution: comp Organization: Duke University CS Dept.; Durham, NC Lines: 42 In article <23078@sequent.UUCP> paulr@crg3.UUCP (Paul Reger) writes: >I was wondering if there exists such a beast as: >void vec_printf(char *fmt,void *args[]); > ... >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: > ... >Without the vec_printf() routine, such a tool would be hard to do. > > paulr (Paul Reger) > {uunet,ucbvax!rutgers!ogccse}!sequent!paulr I picked up a utility called printf (written by Chris Torek) which does just what you describe, and does it quite well. It even does roman numeral conversions. I believe it came across one of the comp.sources groups. Here is an excerpt from the man page: NAME printf - formatted output at shell command level SYNOPSIS printf format-string [ arg1 ] [ arg2 ] ... DESCRIPTION Printf duplicates (as far as possible) the standard C library routine of the same name, at the shell command level. It is similar to echo, except that it formats its arguments according to conversion specifications given in the format-string before writing them to the standard out- put. For a thorough explanation of format specifications, see printf(3s). For the sake of perversity, printf implements one format conversion not supported by the standard printf subroutine: the %r and %R conversions, which print integers as Roman numerals. The first format produces lowercase, and the second uppercase. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ARPA: khera@cs.duke.edu Department of Computer Science CSNET: khera@duke Duke University UUCP: {mcnc,decvax}!duke!khera Durham, NC 27706