grep replacement and /dev/stdin

Chris Torek chris at mimsy.UUCP
Mon Jun 6 07:41:14 AEST 1988


In article <8022 at brl-smoke.ARPA> gwyn at brl-smoke.ARPA (Doug Gwyn ) writes:
>By the way, I hope the new grep when asked to always produce
>the filename will use "-" for stdin's name, and the context
>tool would also follow the same convention.  Even though the
>Research systems have /dev/stdin, other sites may not,

Why not?  We (chris at mimsy.umd.edu and fred at mimsy.umd.edu) have posted
an implementation at least twice.  (Still could not get Berkeley to
include it in 4.3-tahoe, alas; maybe 4.4....)  The implmentation was
easy in 4.1BSD, and not hard in 4.2 and 4.3BSD, so it should be easy in
any pre-networking Unix, and not hard in the networking Unices.  (It
only got harder because Fred wanted to open, not dup, the appropriate
descriptor, and that is not possible for sockets or [presumably] streams.
I believe the V8 /dev/stdin dups fd 0.)

>and anyway (as we've just seen) stdin isn't really a definite
>object.

Neither is `-'.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list