Why is 'more' giving the 'next file' prompt?

Paul Ashton paul at tetrauk.UUCP
Fri May 4 09:05:16 AEST 1990


In article <1990May3.160744.25250 at bath.ac.uk> exspes at bath.ac.uk (P E Smee) writes:
>   cat fred | csh -c 'cat >tempxxx ; more tempxxx'
>
>Before 'more' puts anything out, it gives the 'Next file (tempxxx):'
>prompt.  Why does it think tempxxx is the second file?  What's the
>first?
>

The first file is fred (stdin, which is not a tty so more's in filter mode)
cat has read all stdin so more gets nothing and prompts for the next file.
So for more not to prompt stdin must me a tty. eg
cat fred | csh -c 'cat >tempxxx ; more tempxxx < /dev/tty'

pity you haven't got pg
--
Paul



More information about the Comp.unix.wizards mailing list