[GRASS5] wrapper for awk?
Markus Neteler
neteler at geog.uni-hannover.de
Wed Mar 7 04:49:23 EST 2001
On Wed, Mar 07, 2001 at 09:59:18AM +0700, Justin Hickey wrote:
> Hi Markus
>
> Markus Neteler wrote - slightly rearranged:
> > Maybe "gawk" is a requirement which can't be fulfilled everywhere,
> > then we should consider option 2.
>
> Yes, some machines do not install gawk by default, one being SGI.
>
> However,
>
> > I have just checked SUN's awk which offers:
> >
> > awk
> > awk: Usage: awk [-Fc] [-f source | 'cmds'] [files]
> ^^^^^^
> This is also the case on SGI so why can't we use awk? From the
> fig2grass script we have the following
>
> gawk --source='
>
> function formerr() {
> printf "*** WRONG FIG 3.2 FORMAT ! ***\n"
> exit 1
> }
> <skip>
> ' $1 $2
>
> So why can't we do the following?
>
> awk '
>
> function formerr() {
> printf "*** WRONG FIG 3.2 FORMAT ! ***\n"
> exit 1
> }
> <skip>
> ' $1 $2
You are right. Why not using this "simple" method :-)
Works on Linux... updated in CVS.
Thanks, Justin!
Markus
> If this does not work, then the only option is the second one. That is,
> store the awk script in a separate file and have fig2grass call
>
> awk -f fig2grass.awk
>
> or something like that.
>
> Just my 2 cents worth.
>
> --
> Sincerely,
>
> Jazzman (a.k.a. Justin Hickey) e-mail: jhickey at hpcc.nectec.or.th
> High Performance Computing Center
> National Electronics and Computer Technology Center (NECTEC)
> Bangkok, Thailand
> ==================================================================
> People who think they know everything are very irritating to those
> of us who do. ---Anonymous
>
> Jazz and Trek Rule!!!
> ==================================================================
>
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo at geog.uni-hannover.de with
> subject 'unsubscribe grass5'
>
--
Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'
More information about the grass-dev
mailing list