home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4685 < prev    next >
Encoding:
Text File  |  1992-11-14  |  1.2 KB  |  41 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!almserv!paperwt!s4uhkm
  3. From: s4uhkm@fnma.COM (Howie Michalski)
  4. Subject: Re: setting the output of awk
  5. Message-ID: <1992Nov13.203851.14414@almserv.uucp>
  6. Sender: usenet@almserv.uucp
  7. Nntp-Posting-Host: paperwt
  8. Reply-To: s4uhkm@fnma.COM
  9. Organization: Fannie Mae
  10. References: <1992Nov11.233112.10150@u.washington.edu>
  11. Date: Fri, 13 Nov 1992 20:38:51 GMT
  12. Lines: 27
  13.  
  14. In article 10150@u.washington.edu, micah@carson.u.washington.edu (Micah Anderson) writes:
  15. >How can I set the variable I am selecting with awk to a shell variable??
  16. >Or would this be better done in sed?
  17. >
  18. >for example:
  19. >
  20. >grep ^Subject: $MBOX|awk '{$2}'|=Subject
  21. >
  22. >I want to take the subject from my mail and ake it so I can act upon it
  23. >within shell (|=Subject does not work, btw)
  24.  
  25.  
  26. Try:
  27.  
  28. csh -   set VARIABLE =  `grep ^Subject: $MBOX|awk '{$2}'|=Subject`
  29.  
  30.  sh -  VARIABLE=`grep ^Subject: $MBOX|awk '{$2}'|=Subject`
  31.  
  32. Cheers,
  33. Howie
  34. ---
  35. #include <std_disclaimer.h>                /* Howard Michalski    */
  36. #define OPINIONS "My own"                  /* howie@fnma.COM      */
  37.                                            /* Fannie Mae          */
  38. main()/*iac*/{for(;/*hire*/;);}            /* Washington, DC, USA */
  39.  
  40.  
  41.