home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / MAN / printf.man < prev    next >
Text File  |  2009-11-06  |  3KB  |  151 lines

  1.  
  2.  
  3.      Page 1                                          (printed 1/10/89)
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.      PRINTF(1)          OS9/68000 V2.1 (8-Jan-1987)          PRINTF(1)
  11.  
  12.  
  13.  
  14.      NAME
  15.           printf - formatted output at shell command level
  16.  
  17.      SYNOPSIS
  18.           pprriinnttff _f_o_r_m_a_t-_s_t_r_i_n_g [ _a_r_g_1 ] [ _a_r_g_2 ] ...
  19.  
  20.      DESCRIPTION
  21.           _P_r_i_n_t_f duplicates (as far as possible) the standard C
  22.           library routine of the same name, at the shell command
  23.           level.  It is similar to _e_c_h_o, except that it formats its
  24.           arguments according to conversion specifications given in
  25.           the _f_o_r_m_a_t-_s_t_r_i_n_g before writing them to the standard
  26.           output.  For a thorough explanation of format
  27.           specifications, see _p_r_i_n_t_f(3s).
  28.  
  29.           For the sake of perversity, _p_r_i_n_t_f implements one format
  30.           conversion nnoott supported by the standard printf subroutine:
  31.           the %_r and %_R conversions, which print integers as Roman
  32.           numerals.  The first format produces lowercase, and the
  33.           second uppercase.
  34.  
  35.           As a convenience, within the _f_o_r_m_a_t-_s_t_r_i_n_g and any string or
  36.           character arguments, _p_r_i_n_t_f converts ``backslash notation''
  37.           - as defined in the draft proposed ANSI C Standard X3J11 -
  38.           into the appropriate control characters.  The Standard
  39.           provides for hexadecimal escapes as ``\x1a2F3c4...'', in
  40.           which the only way to terminate the escape is with a non-
  41.           hexadecimal character.  This is not always suitable outside
  42.           the C language, so _p_r_i_n_t_f provides one additional escape,
  43.           \\&&, which expands to nothing, but in so doing serves to
  44.           terminate a hexadecimal escape.
  45.  
  46.      EXAMPLES
  47.           % printf 'Today is %s the %d of %s.\n' Monday 1 April
  48.           Today is Monday the 1 of April.
  49.  
  50.  
  51.  
  52.           % printf 'Interesting Numbers\n\n\tPie: %*.*f\n\tFoo: %g\n' \
  53.                 6 4 3.14159265 42
  54.           Interesting Numbers
  55.  
  56.                 Pie: 3.1416
  57.                 Foo: 42
  58.  
  59.  
  60.  
  61.           % printf '%s %d, %R\n' July 4 1776
  62.           July 4, MDCCLXXVI
  63.  
  64.  
  65.  
  66.           % printf 'in ASCII this prints dd: \x64\&d.\n'
  67.           in ASCII this prints dd: dd.
  68.  
  69.  
  70.  
  71.      AUTHORS
  72.  
  73.  
  74.  
  75.      Page 1                                          (printed 1/10/89)
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.      PRINTF(1)          OS9/68000 V2.1 (8-Jan-1987)          PRINTF(1)
  83.  
  84.  
  85.  
  86.           Fred Blonder <fred@mimsy.umd.edu>
  87.  
  88.           Chris Torek <chris@mimsy.umd.edu>
  89.  
  90.      SEE ALSO
  91.           echo(1), printf(3s)
  92.  
  93.      BUGS
  94.           The  Roman  conversions  are  not  strictly  correct.   Zero
  95.           produces  no  text;  very  large  values  give the complaint
  96.           ``abortive Roman numeral''.   Negative  Roman  numerals  are
  97.           printed  with  a leading minus sign.  It is unclear what the
  98.           Romans did in such cases, although  zero  could  perhaps  be
  99.           written as ``nihil''.  Values in the millions were sometimes
  100.           written using an M with an overbar, but there  is  no  bar-M
  101.           character in ASCII.
  102.  
  103.           The ``%n'' conversion is  unimplementable.   The  number  of
  104.           characters written is not returned.  Long double formats are
  105.           not supported.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.      Page 2                                          (printed 1/10/89)
  148.  
  149.  
  150.  
  151.