LeetCode-195

 Tenth Line

shell编程

#!/bin/bash
lines=0
while read -r line
do
    let lines=lines+1
    if(($lines == 10));then
        echo "$line"
    fi 
done<file.txt

  从file.txt中读数据,echo输出到控制台

while...do...done是bash中的语法结构

原文地址:https://www.cnblogs.com/lcbg/p/6556475.html