sed -n '15,19p' file
#!/bin/shread -p "Input line num: " linelet end=line-1sed -n "15,${end}p" file.txt
我理解你的意思是根据你输入的行数从一个已存在的文件中提取内容。
脚本中假设此文件为file.txt,位于脚本同目录下。
head -n 19 /路径 | tail -n 15