小编Jon*_*emp的帖子

如何使用 Linux 命令模拟 #include <myFile.txt>

因此,我尝试从包含其他文件的源文件创建输出文件。

(我的用例实际上是 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)

text-processing

5
推荐指数
1
解决办法
151
查看次数

标签 统计

text-processing ×1