Re: Problem with export AWKPATH



In article
<e9782a23-f8af-4957-8801-9324e78470ff@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
twf_cc <twfccc@xxxxxxxxx> wrote:

Dear All,

I have a problem with export gawk's enviroment var AWKPATH.
I have some function place in ~/lib/awk, after export AWKPATH
enviroment var, it is worked to call function from ~/lib/awk
here is screen shot
fang@bash ~
$ tail -n6 ~/.bash_profile
export NNTPSERVER='freenews.netfront.net'
export LYNX_CFG="$HOME/lynx.cfg"
export LESSCHARSET=latin1
#export LC_CTYPE=zh_CN.gbk
export CHARSET=GBK
export AWKPATH="/usr/lib/awk:$HOME/lib/awk"

fang@bash ~
$ unset AWKPATH

fang@bash ~
$ echo $AWKPATH


fang@bash ~
$ source .bash_profile

fang@bash ~
$ echo $AWKPATH
/usr/lib/awk:/home/fang/lib/awk

fang@bash ~
$ echo abcd | gawk -f reverse.awk --source '{print reverse($0)}'
dcba

fang@bash ~
$ cat junk
#! /bin/gawk -f reverse.awk --source
{
print reverse($0)
}

fang@bash ~
$ echo abcd | ./junk
gawk: fatal: can't open source file ` reverse.awk --source' for
reading (No such file or directory)

I got a error.....'

The error doesn't seem to have anything to do with AWKPATH, it's with
the way the shebang line is processed. It's treating "reverse.awk
--source" as a single argument.

Most systems have limits on the number of arguments that can be used in
a shebang line. Apparently on your OS, everything after that is treated
as a single argument.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages

  • Problem with export AWKPATH
    ... I have a problem with export gawk's enviroment var AWKPATH. ... $ echo abcd | ./junk ... calling gawk from shell ...
    (comp.unix.shell)
  • Re: AWKPATH question
    ... $ echo $AWKPATH ... You probably haven't exported AWKPATH. ...
    (comp.lang.awk)
  • Re: AWKPATH question
    ... $ echo $AWKPATH ... $ echo abcd | ./junk2 ... You probably haven't exported AWKPATH. ...
    (comp.lang.awk)
  • Re: AWKPATH question
    ... $ echo $AWKPATH ... $ echo abcd | ./junk2 ... You probably haven't exported AWKPATH. ...
    (comp.lang.awk)