1
我正在创建一个命令行lint工具来在Linux上运行。创建一个aspell样式的文件编辑bash脚本
我的输出目前是这样的:
./ex4/task6.7/SumOfCubedDigits.java
> Line 15 has inconsistent indenting
> Line 16 has inconsistent indenting
./ex2/task3.2/YearsBeforeRetirement.java
> Line 0 has a curly brace on the end
./ex2/task3.4/YearsBeforeRetirement.java
> Line 0 has a curly brace on the end
./ex2/task3.7/ThreeWeights.java
> Line 18 has inconsistent indenting
> Line 29 has inconsistent indenting
./ex2/task3.7/fourWeightsCoffeeTime/FourWeights.java
> Line 9 has inconsistent indenting
> Line 11 has inconsistent indenting
./ex2/task2.9/Limerick.java
> Line 0 has a curly brace on the end
通过输出管道进入awk '/.\/ex/{print;}'
我可以只提取文件名:
./ex4/task6.7/SumOfCubedDigits.java
./ex2/task3.2/YearsBeforeRetirement.java
./ex2/task3.4/YearsBeforeRetirement.java
./ex2/task3.7/ThreeWeights.java
./ex2/task3.7/fourWeightsCoffeeTime/FourWeights.java
./ex2/task2.9/Limerick.java
我想打开每个反过来这些文件并编辑它们,也许给每个文件中的错误提供一条消息给用户,因为我打开它们。类似于aspell所做的。
这可能吗?
你为什么不从_within_ emacs的执行命令? – devnull
我不使用emacs:/ –