【发布时间】:2013-01-16 14:15:17
【问题描述】:
我找到了一个 bash script,它列出了在文件开头或结尾处有空行的所有文件。
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
我想将输出传递给一个文件。我将echo 行更改为:
$t -1 $f |egrep '^[ ]*$' >/dev/null && echo "blank line at the $t of $f" > blank_lines.log
但这没有用。
我想问一下&&这个符号是做什么的,为什么上面一行没有把输出传递给文件。
【问题讨论】:
-
你问这个问题已经三个月了。请考虑将答案标记为正确或评论未回答的原因。