home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!almserv!paperwt!s4uhkm
- From: s4uhkm@fnma.COM (Howie Michalski)
- Subject: Re: setting the output of awk
- Message-ID: <1992Nov13.203851.14414@almserv.uucp>
- Sender: usenet@almserv.uucp
- Nntp-Posting-Host: paperwt
- Reply-To: s4uhkm@fnma.COM
- Organization: Fannie Mae
- References: <1992Nov11.233112.10150@u.washington.edu>
- Date: Fri, 13 Nov 1992 20:38:51 GMT
- Lines: 27
-
- In article 10150@u.washington.edu, micah@carson.u.washington.edu (Micah Anderson) writes:
- >How can I set the variable I am selecting with awk to a shell variable??
- >Or would this be better done in sed?
- >
- >for example:
- >
- >grep ^Subject: $MBOX|awk '{$2}'|=Subject
- >
- >I want to take the subject from my mail and ake it so I can act upon it
- >within shell (|=Subject does not work, btw)
-
-
- Try:
-
- csh - set VARIABLE = `grep ^Subject: $MBOX|awk '{$2}'|=Subject`
-
- sh - VARIABLE=`grep ^Subject: $MBOX|awk '{$2}'|=Subject`
-
- Cheers,
- Howie
- ---
- #include <std_disclaimer.h> /* Howard Michalski */
- #define OPINIONS "My own" /* howie@fnma.COM */
- /* Fannie Mae */
- main()/*iac*/{for(;/*hire*/;);} /* Washington, DC, USA */
-
-
-