[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: Why the is output of ls direct to screen and rediect to file dif
From: |
Tomthon |
Subject: |
Re: Re: Why the is output of ls direct to screen and rediect to file different? |
Date: |
Sat, 7 Apr 2007 18:55:29 +0800 |
Do you mean before ls program output it's result,it would get some attributes
from file descriptor 1 such as the screen width? If it can't get it,it would
just output the simple format as one filename per line?
------------------
Tomthon
2007-04-07
-------------------------------------------------------------
Subject:Re: Why the is output of ls direct to screen and rediect to file
different?
On 4/7/07, Tomthon <address@hidden> wrote:
> I have use '>' redirect the output of ls to a file,and then cat the file to
> screen,but the record is comparted by carriage return,not the same as ls
> directly to sreen?What's the reason?
I will answer your question with a question, if I may. How many
columns are available in an as-yet-empty output file? There's no
obvious answer. Therefore there is no obvious width at which the
output should wrap. Also, data sent to a file is frequently read by
another program for further processing. If that is happening, one
filename per line is probably a convenient choice.
James.