Skip to main content
4 events
when toggle format what by license comment
Jan 20, 2015 at 1:56 comment added Rich Homolka I agree with this answer. You can do whatever you want tech wise, but paging stdin doesn't make design sense so you detect it and call it an error. Cat is used in a variety of places where cat stdin makes sense. '(echo header; cat -;echo footer) > /tmp/somefile.txt'. I've also used cat > /proc/whatever
Jan 8, 2015 at 14:37 comment added user732 @boxofchalk1 - for cat, the special case would be checking if file descriptor 0 represents a TTY device, and exiting if it is. If the cat program doesn't find any file names in argv[], it just reads file descriptor 0 until end-of-file.
Jan 8, 2015 at 1:36 comment added boxofchalk1 Thanks @Bruce Ediger for the answer. I did not follow some of the points made in the 2nd paragraph. You said "Coding a special case in cat does not make sense..." Is the special case the tty input?
Jan 7, 2015 at 22:37 history answered user732 CC BY-SA 3.0