3 # zprintf - function that calls gawk to do printf for those systems that
4 # don't have a printf executable
6 # The format and arguments can have trailing commas, just like gawk
9 # zprintf 'Eat %x %x and suck %x!\n' 57005 48879 64206
14 # Copyright 1996 Chester Ramey
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2, or (at your option)
21 # TThis program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software Foundation,
28 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 echo "zprintf: usage: zprintf format [args ...]" >&2
40 args="$args,\"${a%,}\""
43 gawk "BEGIN { printf \"$fmt\" $args }"