bug-gawk
[Top][All Lists]
Advanced

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

Re: Include directive bug fix


From: Eli Zaretskii
Subject: Re: Include directive bug fix
Date: Fri, 05 May 2023 07:46:50 +0300

> Date: Thu, 04 May 2023 17:51:59 +0000
> From:  ykulebiakin via "Bug reports only for gawk." <bug-gawk@gnu.org>
> 
> For example, if we have the following directory structure:
> 
> <root>
> 
> main.awk
> 
> @include "dir1/include.awk"
> 
> include/
> 
> dir1/
> 
> include.awk
> 
> then the following command will not work: AWKPATH=include gawk -f ./main.awk, 
> because AWKPATH is not used then we have a path (with the directory 
> separator) in the @include directive.

This behavior is documented in the manual.  To have subdirectories
searched via AWKPATH, you need to have those subdirectories in AWKPATH
as well, like this:

  AWKPATH=include:include/dir1 gawk -f ...

and say

  @include include.awk

in your program.



reply via email to

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