Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn) Newsgroups: net.micro.att,net.unix-wizards Subject: Re: Re: instability in Berkeley versus AT&T releases (absurdly long) Message-ID: <553@brl-tgr.ARPA> Date: Thu, 8-Aug-85 19:40:21 EDT Article-I.D.: brl-tgr.553 Posted: Thu Aug 8 19:40:21 1985 Date-Received: Sun, 11-Aug-85 07:29:22 EDT References: <2067@ucf-cs.UUCP> <363@cuae2.UUCP> <2423@sun.uucp> Organization: Ballistic Research Lab Lines: 46 Xref: linus net.micro.att:450 net.unix-wizards:11462 > > > The only thing terrible about ls -C is that it ought to be the default for > > > CRTs. USG ls _requires_ the "-C" to get the multiple columns, which _is_ > > > brain damaged. > > > > I would sure get upset if when I ran "ls" in the long skinny window > > on my DMD, it didn't print the file names one per line. You are > > making the same mistake that a lot of the more crufty BSD software > > has made, namely: assuming an overly-restrictive model of how the > > software is to be used. > > Actually, the SVR2 ls -C looks at the COLUMNS variable to find out how much > space is available, and adjusts the number of columns accordingly. > The 4.1BSD ls checked whether isatty(stdout), and set the output to single or > multi-column accordingly; I always hated that since I normally wanted > multi-column all the time. Columnators should also do an ioctl(TIOCGWINSZ) or the DMD equivalent. Our "mpx" does not alter the COLUMNS environment variable for each layer, but rather stores the window size in the tty structure. Actually, if you want columnated "ls", given the way "ls" works it is necessary to either build the columnation into "ls" or to provide a very specific columnizing filter, since "ls" lists multiple directories WITH HEADERS so that simple-minded columnizing will mess up the output. I think the SVR2 method (requiring an explicit request for columnation) is preferable to Berkeley's automatic behavior. It is very easy to make up a shell function, alias, or script like l(){ ls -Cf $*; } to make your own personalized "l" command if you want one. Default command behavior should be simple, with complexities reserved for the options. P.S. I think I started the "ls" debate, but all I said was that I thought "ls -[a-z][A-Z]" was yucky (too many options to remember). I don't like a directory-entry listing utility having to know about terminal characteristics, though. This seems like an unnecessary combining of function. I like Peter Weinberger's idea of having a directory format that is directly printable: 10038 . 10039 .. 10502 myfile 10501 mydir etc. It would even be nice to get rid of . and .. I guess it's too late...