From: gwtmp01@... Date: 2006-09-29T00:12:45+09:00 Subject: Re: how to determine if pipe is given On Sep 28, 2006, at 1:03 AM, Robert Dober wrote: > Ara's idea is how it is done in Unix, I do not know why he got so much > critisized for it :( Actually I think the 'normal' thing in Unix is to simply do blocking reads from stdin if there are no file arguments. This is exactly what ARGF does. It is decidedly non-standard to *require* the use of a sentinel such as '-' (or even better /dev/stdin) to cause a program to read from stdin. And I believe this is what the OP is looking for. I just don't think it makes a lot of sense. For example, standard input redirection would have to be done as: program - < /some/file/to/read which is strange. Pipes also: source | program - In both cases if you leave off the '-' the program will report an error rather than reading and processing the data. The next programmer who comes along is going to be very confused by this behavior. Can anyone think of a standard Unix program that will *only* read from stdin in if you give an explicit sentinel as a file argument? Gary Wright