[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
nl-command bug
From: |
Silvano Catinella |
Subject: |
nl-command bug |
Date: |
Thu, 1 Dec 2005 06:39:43 -0800 (PST) |
Hello,
I have discovered a little bug in nl command written by Scott Bartram and
David MacKenzie. When I push an ASCII-color-text into the pipe used by nl, I
can see a very strange behavior.
Usually, if I use "-b t" argument I would see no line-number before empty line.
But with ASCII-color the program considers escape-codes (\033[....m) as text
and prints number before empty lines. For example the following command
$ ls coreutils-5.93 --color=always |nl -b t
...produces the following output:
1 ABOUT-NLS
2 AUTHORS
3 COPYING
[ ... ]
28 po
29 src
30 tests
31
"tests" file has blue color because it is a directory, and, as you can see the
nl-process prints a empty line (31) next.
If I do not use ASCII-colors I obtain different behavior:
$ ls coreutils-5.93 |nl -b t
1 ABOUT-NLS
2 AUTHORS
3 COPYING
[ ... ]
28 po
29 src
30 tests
as you can see the empty line is not printed in this way.
I have written a new version of nl command, please find the source-file as
attach.
In my version I have add a feature to setting the record-separator string. I
have no yet implemented the regexp on flag -b, but if you consider my
contribute useful, I will happy to complete this task.
I will look for your answer.
Goodbye
Silvano Catinella
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
nl-1133444425.c
Description: 4065792782-nl-1133444425.c
- nl-command bug,
Silvano Catinella <=