A question on [a,ga,na]wk.

Binod K. Taterway bt00 at PL118d.?
Thu Nov 29 02:53:23 AEST 1990


Is it possible to make use of c-shell variables in [g,n]awk scripts.
What I need to do some thing like this:

  #!/bin/csh
  set AWK=/usr/local/bin/gawk
  set date=`date +%m/%d/%y`
  # Now the awk script that uses $date:
  $AWK -F: '{if ($3 == $date) {print $0}}' <source-file>
  # End of shell script.

I checked  with [g,n]awk. Only gawk  can access environment variables,
but I do not want to  do  "setenv date= ..",  just "set date= ..". Any
suggestions? Or, am I stuck with using setenv?

Thanks in advance.

/Binod.
--------------------
Binod Taterway		bt00 at pl118a.cc.lehigh.edu | bt00 at lehigh.bitnet
User Consultant, Lehigh University, Bethlehem, PA 18015	(215) 758-3984



More information about the Comp.unix.shell mailing list