/bin/ls -C Question

Carl Lowenstein cdl at mplvax.ARPA
Fri Feb 21 01:19:27 AEST 1986


In article <337 at chinet.UUCP> megabyte at chinet.UUCP (Mark E. Sunderlin) writes:
>Ok, here is my question to the net.  Why does ls -C Sometimes
>NOT print across the screen?  
>But some times a directory will list one per line on me.  What does
>ls make this decision on?  I have seen this behavior on both at&t 3b2
>machines and on Tandy 6000 machines. (sys V on one Xenix 3 on the latter)

This seems to be the now-famous SysV 14-character filename bug.  Directories
have exactly 14 bytes allocated for the file name, so a full-length name
can't have a null terminator.  When ls(1) tries to compute the number
of columns to use for the -C option it gets some ridiculously long length
for one of the file names, and gives up and uses a single column.

-- 
	carl lowenstein		marine physical lab	u.c. san diego
	{ihnp4|decvax|akgua|dcdwest|ucbvax}	!sdcsvax!mplvax!cdl



More information about the Comp.unix mailing list