因此,我尝试从包含其他文件的源文件创建输出文件。
(我的用例实际上是 Kubernetes/OpenShift 的 YAML,但这些 .txt 文件显示了目标。)
例如:
% cat source.txt
This is the source files it will include two other files.
The first will be here:
#INCLUDE ./first-included-file.txt
And the second file will be inserted here:
#INCLUDE ./second-included-file.txt
And this is the end of source.txt
Run Code Online (Sandbox Code Playgroud)
如果包含的文件是:
% cat first-included-file.txt
This is FIRST
End of FIRST
% cat second-included-file.txt
This is SECOND
End of SECOND
Run Code Online (Sandbox Code Playgroud)
那么输出将是:
This is the source files it will include two other files.
The first will …
Run Code Online (Sandbox Code Playgroud)