Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的脚本正在使用 while 循环逐行读取 xyz.txt 文件,如果条件匹配,我想打印下一行。例如,如果 [ "$count" -gt "5" ]; 然后
好心劝告。
谢谢,
awk 或 sed 是更好的选择 awk 示例:
awk 'FNR>5' inputfile
外壳中的相同内容
cnt=0 while read rec do cnt=$(( $cnt + 1)) [ $cnt -gt 5 ] && echo "$rec" done < inputfile