2
zhangxiao 2012-09-26 17:50:26 +08:00 1
#!/bin/bash
awk -v initial_line=$1 -v end_line=$2 '{ if (NR >= initial_line && NR <= end_line) print $0 }' $3 使用方法: ./script.sh <start> <to> bigfile.txt 写个循环就行了。 来自:http://stackoverflow.com/questions/604864/print-a-file-skipping-x-lines-in-bash |