Subject: Re: CVS commit: src/bin/ls
To: None <jschauma@netbsd.org>
From: Perry E. Metzger <perry@piermont.com>
List: source-changes
Date: 04/09/2006 00:03:51
Jan Schaumann <jschauma@netbsd.org> writes:
> Module Name:	src
> Committed By:	jschauma
> Date:		Sat Apr  8 22:28:06 UTC 2006
>
> Modified Files:
> 	src/bin/ls: ls.1 util.c
>
> Log Message:
> Address PR 30374 as suggested in there:
>
> "Modify the man page to match the behaviour of "ls -q",
>
> (done by yamt@ previously)
>
> ...
> modify both the behaviour and documentation for "ls -b" and "ls -B" to
> make spaces readily apparent.  This could be done by adding VIS_WHITE
> to the flags passed to strvis(3) in the safe_print() function in
> src/bin/ls/util.c."
>
> 'ls -b' now yields foo\sbar (whitespace) foo\tbar (tab) foo\rbar (CR).
> 'ls -B' now yields foo\040bar foo\011bar foo\015bar.

Hrm. \s isn't read by the shell. "\ " is.

Having -b do things like "\ " means you can feed the output of ls -b
into the shell and actually get the right file even if it has spaces
etc. in it. I think that's a valuable application. Even C doesn't
parse \s so far as I know...

Perry