脚本宝典收集整理的这篇文章主要介绍了php – 在BOF或EOF中查找包含Blank或WS的所有文件,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个awk脚本将修改文件.我将所有文件传递给它,事情是桃子的,没有更多的前导或尾随空行.
我试过这样的事情:
grep -r -e :a -e '/^\n*$/{$d;N;};/\n$/ba'
但那是错的.
for f in `find . -tyPE f`; do for t in head tail; do $t -1 $f |egrep '^[ ]*$' >/dev/null && echo "blank line at the $t of $f"; done; done
为了便于阅读,我打破了这些线条,但你也可以将它作为一个衬垫运行.
示例输出:
blank line at the head of ./b blank line at the tail of ./c blank line at the head of ./d blank line at the tail of ./d
以上是脚本宝典为你收集整理的php – 在BOF或EOF中查找包含Blank或WS的所有文件全部内容,希望文章能够帮你解决php – 在BOF或EOF中查找包含Blank或WS的所有文件所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。