home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!rutgers!cmcl2!adm!news
- From: karron@karron.med.nyu.edu (Dan Karron (karron@nyu.edu))
- Newsgroups: comp.sys.sgi
- Subject: Re: Nawk Bug NOT!
- Message-ID: <34114@adm.brl.mil>
- Date: 16 Nov 92 20:36:20 GMT
- Sender: news@adm.brl.mil
- Lines: 25
-
- The syntax is ?? Wrong ?? for sprintf.
- This works.
- Putting the target of the sprintf assignment inside the
- braces doe not work. Nawk sprintf returns its value as
- a function, unlike the C analog.
-
- prog='
- BEGIN {
- i=1
- printf("%03d\n",i);
- string=sprintf("%03d",i);
- print "string=",string
- }
- '
- nawk "$prog"
-
- Thanks to John Rupley at cs.arizona.edu for pointing this out to me.
-
- Dan.
-
- | karron@nyu.edu (e-mail alias ) Dan Karron, Research Associate |
- | Phone: 212 263 5210 Fax: 212 263 7190 New York University Medical Center |
- | 560 First Avenue Digital Pager <1> 212 397 9330 |
- | New York, New York 10016 <2> 10896 <3> <your-number-here> |
- ``Too busy doing to write about it, too busy writing to do anything about it.''
-