【发布时间】:2011-03-23 16:39:51
【问题描述】:
标题总结了它。我在 Unix,korn shell 中工作。我正在尝试打印当前文件夹中每个文件超过 80 个字符的每一行的文件名和行号。
我可以使用 "awk 'length > 80' *.cpp" 给出所有超过 80 个字符的行,但我似乎无法提取行号或文件名。我也尝试使用 cat ,因为它允许使用行号。
这个想法是得到类似这样的输出:
test.cpp line 36
std::cout << ... line that is over 80 characters
test2.cpp line 40
Another line that is over 80 characters
任何帮助都会很棒。
【问题讨论】: