Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!ece-csc!ncrcae!ncr-sd!hp-sdd!ucsdhub!sdcsvax!ames!lll-tis!ptsfa!ihnp4!ihdev!pdg From: pdg@ihdev.ATT.COM (Joe Isuzu) Newsgroups: comp.unix.questions Subject: Re: awk question Message-ID: <1471@ihdev.ATT.COM> Date: Wed, 1-Jul-87 19:38:28 EDT Article-I.D.: ihdev.1471 Posted: Wed Jul 1 19:38:28 1987 Date-Received: Sat, 4-Jul-87 03:44:27 EDT References: <718@trwcsed.trwrb.UUCP> Reply-To: pdg@ihdev.UUCP (Joe Isuzu) Organization: American Nasal Amputation Centre Lines: 35 In article <718@trwcsed.trwrb.UUCP> kraml@trwcsed.UUCP (Robert P. Kraml) writes: >I have a question concerning the awk utility. Does anyone know if >there is a way to pass awk variables out as shell variables on a >line-by-line basis. What I mean is the following: >1. awk reads in a line of NF fields >2. some of those fields get passed out as shell variables >3. These variables are operated on (i.e. put into certain files). >4. Awk reads another line and so on... Easy. Do something like this..... $eval `awk -f awks` where awks is: { print $1 "=" $2; } or something like that. With input of abc def xyzzy plugh ^D you will find that $abc is def and $xyzzy is plugh, when you are back at the shell. This format requires that you are using ksh or sh. For csh, the line that formats the setting arguments should be print "set " $1 " " $2; Hope this helped. -- Paul Guthrie "Another day, another Jaguar" ihnp4!ihdev!pdg -- Pat Sajak