Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: POSIX conformance in coreutils



On 12 Jan, Peter wrote:
> Vin Shelton wrote:
> > I checked and I do not have POSIXLY_CORRECT set.  Here's what the
> > 'Standards conformance' section of the coreutils info says:
> 
> It doesn't look like we can expect much sense, then.
> 
> Here is a more heavyweight change.

> +  if [[ -z $TAIL_SUPPORTS_MINUS_N ]]; then

Would it perhaps be easier to just use something like this:

  tail() {
    local arr
    arr=( ${(f)"$(</dev/fd/0)"} )
    print -lr -- $arr[${1:--10},-1]
  }

It's shorter and potentially tests other zsh features as a side-effect
(such as emulating /dev/fd in redirections).

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author