home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / wizards / 3720 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.1 KB  |  41 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!shearson.com!news
  3. From: fgreco@shearson.com (Frank Greco)
  4. Subject: tokens modification
  5. Message-ID: <1992Aug27.232956.19826@shearson.com>
  6. Sender: news@shearson.com (News)
  7. Organization: Lehman Brothers
  8. Distribution: usa
  9. Date: Thu, 27 Aug 1992 23:29:56 GMT
  10. Lines: 29
  11.  
  12. Bourne/Korn shell wizards, I beseech thee.
  13.  
  14. I have a string with the cmd line args:
  15.  
  16.     55 "hello world" frank 1900
  17.  
  18. I am trying to sed-ify/awk-ify/shell-ify it into the following:
  19.  
  20.     55, "hello world", frank, 1900
  21.  
  22. Anyone have any good ideas as to do this?  
  23.  
  24. Thanks,
  25.  
  26. Frank G.
  27.  
  28. In case you're interested, I'm trying to create a printf() shell
  29. function via front-ending awk, i.e.:
  30.  
  31.     printf() {
  32.         fmt=$1; shift
  33.         # manipulate args to be $@ with commas
  34.         echo "$@" | awk "END {printf $fmt, $args}"
  35.     }
  36. --
  37. +-On Assignment at: Lehman Brothers-+-Office: Mercury Technologies, Inc.-+
  38. | World Financial Center, 11th Floor| PO Box 529                         |
  39. | New York City, NY 10285           | Fanwood, NJ 07023                  |
  40. | email: fgreco@shearson.com        | email: fgreco@mercury.com          |
  41.