Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Nov 2004 23:58:05 +0600
From:      Dmitry Frolov <frolov@riss-telecom.ru>
To:        freebsd-current@freebsd.org
Cc:        tjr@freebsd.org
Subject:   cut(1) behaviour changed since 5.2.1
Message-ID:  <20041104175805.GA69815@nerve.riss-telecom.ru>

next in thread | raw e-mail | index | archive | help
[ Cc'ing tjr@ because he is the comitter of the change in question ]

I'm experiencing a minor problem with cut(1) while trying to run shell
script (installer), written for FreeBSD 5.2.1, on 5.3-RC1 system.

I don't know if it's really a bug, but if it is someone may want look
at it. The problem is that on 5.3 cut returns 'Illegal byte sequence'
(EILSEQ) error while parsing files without trailing newline, while on
5.2.1 it doesn't. It looks like the behaviour was changed with the
revision 1.27 of the cut.c (about handling of multibyte characters).

Here is the demonstration:

frol@atlas ttyp0:~$uname -spr
FreeBSD 5.3-RC1 i386
frol@atlas ttyp0:~$echo aaa:bbb | cut -d : -f 1
aaa
frol@atlas ttyp0:~$echo -n aaa:bbb | cut -d : -f 1
cut: stdin: Illegal byte sequence
frol@atlas ttyp0:~$echo $?
1

However on 5.2.1 all goes well:

frol@sva ttyp0:~$uname -spr 
FreeBSD 5.2.1-RELEASE-p7 i386
frol@sva ttyp0:~$echo aaa:bbb | cut -d : -f 1
aaa
frol@sva ttyp0:~$echo -n aaa:bbb | cut -d : -f 1
aaa
frol@sva ttyp0:~$echo $?
0

    wbr&w, dmitry.
-- 
Dmitry Frolov <frolov@riss-telecom.ru>
RISS-Telecom Network, Novosibirsk, Russia
66415911@ICQ, +7 3832 NO WA1T, DVF-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041104175805.GA69815>