LeetCode 195. 第十行(shell,awk或sed)

Posted live4m

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode 195. 第十行(shell,awk或sed)相关的知识,希望对你有一定的参考价值。

题意:

给定一个文本文件 file.txt,请只打印这个文件中的第十行。

code:

# Read from the file file.txt and output the tenth line to stdout.

#awk '{if(NR==10){print}}' file.txt

sed -n '10p' file.txt

以上是关于LeetCode 195. 第十行(shell,awk或sed)的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode(Shell)- 195. 第十行

LeetCode刷题 Shell编程四则 | 194. 转置文件 192. 统计词频 193. 有效电话号码 195. 第十行

LeetCode(Shell)- 题集

LeetCode(Shell)- 题集

LeetCode关于shell的几个问题

195-第十行