Re: Head -n argument position matters

Jim Meyering <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Thanks for the report.
That's the expected behavior, because options like `-1'
are obsolete.  If you want to be able to put an option after
non-option arguments, you have to use the newer form: `-n 1'.

FYI, there is now another reason to switch away from using `head -N':
With the latest test release I get this:

  $ env _POSIX2_VERSION=200112 head -1
  head: `-1' option is obsolete; use `-n 1'
  Try `head --help' for more information.
  [Exit 1]

Of course, by default it doesn't fail or even issue a warning.
But the writing is on the wall...

Edward Avis <[email protected]> wrote:
> % head -1 foo
> This is the first line of foo.
> % head foo -1
> head: invalid option -- 1
> Try `head --help' for more information.
> % head --version
> head (textutils) 2.0.21
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.