[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion for new coreutil: "every" prints every M out of N lines
From: |
Brian Dessent |
Subject: |
Re: Suggestion for new coreutil: "every" prints every M out of N lines |
Date: |
Fri, 14 Oct 2005 21:46:03 -0700 |
Wayne Hayes wrote:
> SYNOPSIS:
> every [-M[,N]] [OPTIONS] [list-of-files]
>
> DESCRIPTION
> Print N lines out of every M lines in a file. If no files are
> listed, use the standard input. N and M both default to 1, so that
> every(1) without options acts like cat(1). Every(1) can also work
> on bytes or blocks instead of lines.
Can't you pretty much achieve the same thing with:
awk '(FNR-1) % M < N' file
Brian