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

Re: POSIX conformance in coreutils



Oliver Kiddle wrote:
> 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).

I don't think /dev/fd is currently faked to that extent.  There's
special handling for tests, and /dev/fd is sometimes used to *implement*
process substitution, but it won't handle it specially there.  You could
build up arr some other way, of course.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



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