home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!shearson.com!news
- From: fgreco@shearson.com (Frank Greco)
- Subject: tokens modification
- Message-ID: <1992Aug27.232956.19826@shearson.com>
- Sender: news@shearson.com (News)
- Organization: Lehman Brothers
- Distribution: usa
- Date: Thu, 27 Aug 1992 23:29:56 GMT
- Lines: 29
-
- Bourne/Korn shell wizards, I beseech thee.
-
- I have a string with the cmd line args:
-
- 55 "hello world" frank 1900
-
- I am trying to sed-ify/awk-ify/shell-ify it into the following:
-
- 55, "hello world", frank, 1900
-
- Anyone have any good ideas as to do this?
-
- Thanks,
-
- Frank G.
-
- In case you're interested, I'm trying to create a printf() shell
- function via front-ending awk, i.e.:
-
- printf() {
- fmt=$1; shift
- # manipulate args to be $@ with commas
- echo "$@" | awk "END {printf $fmt, $args}"
- }
- --
- +-On Assignment at: Lehman Brothers-+-Office: Mercury Technologies, Inc.-+
- | World Financial Center, 11th Floor| PO Box 529 |
- | New York City, NY 10285 | Fanwood, NJ 07023 |
- | email: fgreco@shearson.com | email: fgreco@mercury.com |
-