[cs631apue] Midterm Question

jphillip jphillip at stevens.edu
Sat Sep 22 15:11:54 EDT 2012


Thanks Jan,  That makes sense.  I was confused because I was not clear 
about the concept of a stream which is what stdout is.

On Sat, 22 Sep 2012 11:39:02 -0400, Jan Schaumann wrote:
> jphillip <jphillip at stevens.edu> wrote:
>> In the man page for 'ls' I sometimes see the phrase 'This is the 
>> default
>> when output is not to a terminal.'
>>
>> I am confused by this because I thought ls always printed to 
>> standard
>> output so why would this need to be stated?
>
> Standard out is different from "to a terminal".  Standard out may be
> connected to a terminal:
>
> ls
>
> Standard out may be connected to a pipe:
>
> ls | more
>
> Standard out may be connected to a file:
>
> ls >file
>
>
> Take a look at isatty(3), which may be helpful here.
>
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue



More information about the cs631apue mailing list