Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: edit first line of long file Message-ID: <16991:Oct2420:40:0590@kramden.acf.nyu.edu> Date: 24 Oct 90 20:40:05 GMT References: <4597:Oct2321:44:2190@kramden.acf.nyu.edu> <10201:Oct2404:23:3890@kramden.acf.nyu.edu> <27144@mimsy.umd.edu> Organization: IR Lines: 19 In article <27144@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: > At least one POSIX draft has attempted to mandate that stdio should > `reset' the input seek pointer so that (head -1; cat) an exact copy of file foo. [ explanation of various problems this would introduce ] > This > approach is doomed to failure I agree. However, your comments do not apply to *specific* programs (such as head)---only to the general problems of kludging this sort of seek into stdio. Many cloners find it fashionable to seek to the ``proper'' place before closing fd 0. The version of head I'm using does this, so my tests worked. My first solution is not portable to versions of head that don't do the same, but it is not ``doomed to failure''; BSD 4.4 could easily ``doom'' it to success. ---Dan