I think this will work for you, untested:
awk 'NR >= 5 && NR <= 5 + Y { print $X }' file.txt
Obviously, substitute X
and Y
for some real values.
EDIT:
If X
and Y
are shell variables:
awk -v column="$X" -v range="$Y" 'NR >= 5 && NR <= 5 + range { print $column }' file.txt
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…