| Summary: | added "force printing of non-print chars" flag to /bin/ls | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Jordan.DeLong <Jordan.DeLong> | ||||
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.3-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Jordan.DeLong
2001-06-10 09:00:09 UTC
On Sun, Jun 10, 2001 at 12:56:42AM -0700, Jordan.DeLong@cx420564-b.tucson1.az.home.com wrote: > > >Number: 28007 > >Category: bin > >Synopsis: added "force printing of non-print chars" flag to /bin/ls > >Originator: Jordan DeLong > >Release: FreeBSD 4.3-RELEASE i386 > >Organization: > None > >Environment: > System: FreeBSD cx420564-b 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Tue Apr 24 08:33:58 GMT 2001 fracture@cx420564-b:/usr/src/sys/compile/HOBOIV i386 > > >Description: > when the output of /bin/ls is not to a terminal, it defaults to > printing non-printable characters directly. However, when output > is to a tty there is no way to make it output non-printable chars. > > /bin/ls uses isprint() to determine if a character is printable; > this includes high-bit ascii characters that really are printable > in some settings, and also includes filenames that have kanji in > them. So forcing the raw printing of these characters can be > desirable even on a tty, particularly for those who use languages > other than English that make use of characters that don't fall in > isprint(). Correct me if I'm wrong, but doesn't isprint() conform to locale settigs? I don't know if this works with multibyte characters, but for 8-bit locales ls(1) certainly does the right thing, due to a setlocale(LC_ALL, "") call at the very start. > I've added a -w flag to /bin/ls that is used to force raw output > of nonprintable characters when the output is a tty. Other than the above argumet, yes, such a flag could be useful. G'luck, Peter -- This sentence no verb. On Mon, Jun 11, 2001 at 09:06:41AM +0300, Peter Pentchev wrote: > > Correct me if I'm wrong, but doesn't isprint() conform to locale settigs? > I don't know if this works with multibyte characters, but for 8-bit locales > ls(1) certainly does the right thing, due to a setlocale(LC_ALL, "") call > at the very start. > Actually I discovered this only a few hours ago (I was under the impression that isprint() was a simple macro that just checked if it was > 32 and < 127 or somesuch). So I was mistaken and everything is alright on that that front for /bin/ls. > > I've added a -w flag to /bin/ls that is used to force raw output > > of nonprintable characters when the output is a tty. > > Other than the above argumet, yes, such a flag could be useful. > agreed, I think it could still be useful. -- Jordan DeLong fracture@allusion.net State Changed From-To: open->closed Committed to -current. Thanks. |