您可以使用head和tail命令来实现从第10行读取到第20行。以下是一个示例代码:

count=0
while read -r line
do
  ((count++))
  if [ $count -ge 10 ] && [ $count -le 20 ]; then
    echo $line
  fi
done < jobid.txt

在这个代码中,count变量用来计数行数。当count的值在10到20之间时,echo $line语句会将该行输出。

while read -r linedodone jobidtxt如何实现从第10行读取到第20行

原文地址: https://www.cveoy.top/t/topic/iGw3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录