Linux的tac命令的多种实现

本文最后更新于2015年6月8日,已超过 1 年没有更新,如果文章内容失效,还请反馈给我,谢谢!

搜索关键字:
  • use awk to read a file in reverse
参考链接:
参考解答:

注意,上面这个Python版本的无法写在一行上面,否则会报错:

搜索关键字:
  • python one line for loop error
解释:

根据Python的语法规则,while和for语句前面是不能有分号的(复合语句都不能全写在一行):

while, for can’t have semicolon before, they need to be on one line. If you looked at Python grammar:

you will see that the statements that are part of compound_stmt need to be one one line alone. The only statements that can be separated by semicolon are simple_stmt group:

=EOF=

声明: 除非注明,ixyzero.com文章均为原创,转载请以链接形式标明本文地址,谢谢!
https://ixyzero.com/blog/archives/2215.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注