Re: Problem with export AWKPATH
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Sat, 29 Mar 2008 17:14:07 -0400
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 ***
.
- References:
- Problem with export AWKPATH
- From: twf_cc
- Problem with export AWKPATH
- Prev by Date: Re: while /usr/bin/read
- Next by Date: Re: while /usr/bin/read
- Previous by thread: Problem with export AWKPATH
- Next by thread: Get the parameter pattern from command line
- Index(es):
Relevant Pages
|
|