home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
- From: etxmesa@eos.ericsson.se (Michael Salmon)
- Subject: Re: Awk question
- Message-ID: <1992Sep2.073636.4871@ericsson.se>
- Sender: news@ericsson.se
- Nntp-Posting-Host: eos6c02.ericsson.se
- Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
- Organization: Ericsson Telecom AB
- References: <BtxLJ3.BzE@nntp-sc.Intel.COM>
- Date: Wed, 2 Sep 1992 07:36:36 GMT
- Lines: 35
-
- In article <BtxLJ3.BzE@nntp-sc.Intel.COM>,
- brodesky@td2cad.intel.com (Michael Brodesky) writes:
- |>
- |>
- |> I would like to get the current year into my awk program. Any
- |> clues into doing this?
- |>
- |> Do I need to
- |> date |nawk -f code inputfile
- |>
- |>
- |> code
- |> {
- |> print $6
- |> }
- |>
- |>
- |> Only problem is it does not work.
-
- I think that you need to insert a - to tell nawk to read stdin, however
- this is perhaps a better solution:
-
- eos6c02 xanim 40 > nawk 'BEGIN { print year }' `date +year=%y`
- 92
-
- --
-
- Michael Salmon
-
- #include <standard.disclaimer>
- #include <witty.saying>
- #include <fancy.pseudo.graphics>
-
- Ericsson Telecom AB
- Stockholm
-