【发布时间】:2011-08-07 14:47:12
【问题描述】:
我刚开始阅读有关识字编程的文章和noweb - 我觉得它很有趣。据我了解,'notangle' 步骤是从文字编程(源)文件中提取(机器)源代码(文件)的步骤。
在这里,我对一个特定方面感兴趣:我希望能够一次提取多个源文件(在notangle 步骤中),包括一个执行脚本 - 和在同一步骤中运行执行脚本!
bash 中的示例如下所示:
#!/usr/bin/env bash
# file: test.c.gdb.sh
# generate C source file
cat > test.c <<"EOF"
#include "stdio.h"
int main(void) {
return 0;
}
EOF
# generate gdb script file
cat > test.gdb <<"EOF"
break main
run
EOF
# run the 'execution script'
gcc -g -Wall test.c -o test.exe
chmod +x test.exe
gdb -x test.gdb -se test.exe
这里的重点是,我可以从 shell 调用 './test.c.gdb.sh',然后生成源文件,然后编译,然后自动启动调试器。
是否有文字编程工具允许在notangle 步骤中执行类似的操作?
提前感谢您的任何回答,
干杯!
【问题讨论】:
标签: shell extract execute literate-programming