Date: Tue, 24 Aug 2004 02:15:53 -0400 From: "Gerald S. Stoller" <gs_stoller@hotmail.com> To: freebsd-questions@FreeBSD.ORG Subject: The printf function Message-ID: <BAY10-F42RUhXSbmNeO0005428c@hotmail.com>
next in thread | raw e-mail | index | archive | help
I executed the following printf (in a Korn shell command-line) printf 't %2$s .\n' 3 55 and got the following response printf: illegal format character $ The following is an excerpt from the man-3 page for printf . Each conversion specification is introduced by the character %. The arguments must correspond properly (after type promo- tion) with the conversion specifier. After the %, the following appear in sequence: o An optional field, consisting of a decimal digit string followed by a $, specifying the next argument to access . If this field is not provided, the argument following the last argument accessed will be used. Arguments are numbered starting at 1. If unaccessed arguments in the format string are interspersed with ones that are accessed the results will be indeterminate. The printf should have produced "t 55 ." as output. Can we please get it fixed?!?! My system is FreeBSD 4.3 on: FreeBSD 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 2001 jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC i386 _________________________________________________________________ Get ready for school! Find articles, homework help and more in the Back to School Guide! http://special.msn.com/network/04backtoschool.armx
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY10-F42RUhXSbmNeO0005428c>