bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug path


From: arnold
Subject: Re: bug path
Date: Sat, 07 Nov 2020 21:05:20 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Neil's answer is on target. The default AWKPATH built into gawk
includes "." as the first entry; it sounds like AWKPATH on your
system is not set correctly.  I don't have it set in my environment;
here's what things look like for me:

$ echo $AWKPATH

$ gawk 'BEGIN{print ENVIRON["AWKPATH"]}'
.:/usr/local/share/awk

Thanks,

Arnold

"Neil R. Ormos" <ormos-gnulists17@ormos.org> wrote:

> Roberto do Rego wrote:
>
> > OS 5.8.16-2-MANJARO #1 SMP PREEMPT Mon Oct 19 11:33:03 UTC 2020 x86_64
> > GNU/Linux
> > VERSION GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)
>
> > Version 5.1 has a simple flaw but it generates
> > problems when executing scripts, basically the
> > gawk interpreter does not recognize the current
> > work directory. In other words, it is necessary
> > to indicate the complete path of the script to
> > run it correctly.
>
> > Example:
> > $pwd
> > /home/user
> > $ gawk -f script.awk
> > Generates error:
> > gawk: fatal: unable to open source file "script.awk" for reading: File or
> > directory does not exist.
> > Just enter the full path to avoid the problemand the script runs normally.
> > Example:
> > $ gawk -f /home/user/script.awk
> > -hELLO WORLD!
> > This flaw is also present in the Windows version, making it impossible to 
> > use
> > the relative path etc.
> > 
> > I hope I helped, thank you all and good luck!
>
> Have you checked the value of the AWKPATH
> environment variable?  E.g. via
>   
>   gawk 'BEGIN{print ENVIRON["AWKPATH"]}'
>
> Does AWKPATH contain a null entry or "."?  This
> section of the manual might be of help:
>
>   <http://www.gnu.org/software/gawk/manual/html_node/AWKPATH-Variable.html>
>
> and especially footnote 14. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]