From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 15:55:36 2011 Received: (at submit) by debbugs.gnu.org; 7 Apr 2011 19:55:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7vIl-00083G-Iz for submit@debbugs.gnu.org; Thu, 07 Apr 2011 15:55:36 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7v5t-0007kJ-GR for submit@debbugs.gnu.org; Thu, 07 Apr 2011 15:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7v5m-0000Ol-2o for submit@debbugs.gnu.org; Thu, 07 Apr 2011 15:42:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:45816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7v5l-0000Oc-SZ for submit@debbugs.gnu.org; Thu, 07 Apr 2011 15:42:10 -0400 Received: from [140.186.70.92] (port=56914 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7v5k-0006Eq-E4 for bug-coreutils@gnu.org; Thu, 07 Apr 2011 15:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7v5i-0000Mh-Hv for bug-coreutils@gnu.org; Thu, 07 Apr 2011 15:42:08 -0400 Received: from service2-us.mimecast.com ([205.139.110.10]:41127) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q7v5i-0000MU-CB for bug-coreutils@gnu.org; Thu, 07 Apr 2011 15:42:06 -0400 Received: from mailsmtp01.cocp.com (41339fbe.cst.lightpath.net [65.51.159.190]) by service1-us.mimecast.com; Thu, 07 Apr 2011 15:40:52 -0400 Received: from njitexch01.cocp.com ([10.1.35.95]) by mailsmtp01.cocp.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Apr 2011 15:40:51 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: sort command in Redhat 5 does not work Date: Thu, 7 Apr 2011 15:40:36 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: sort command in Redhat 5 does not work Thread-Index: Acv1W6r3OSmG860pRGuev2+6YJpPPw== From: "Jyotin Patel" To: X-OriginalArrivalTime: 07 Apr 2011 19:40:51.0975 (UTC) FILETIME=[B3EE2970:01CBF55B] X-MC-Unique: 111040715405201201 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBF55B.B3E6CBB2" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 07 Apr 2011 15:55:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) This is a multi-part message in MIME format. ------_=_NextPart_001_01CBF55B.B3E6CBB2 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable [root@cnprodftp02 root]# cat /etc/redhat-release Red Hat Enterprise Linux AS release 3 (Taroon Update 5) [root@cnprodftp02 root]# sort [root@cnprodftp02 root]# set -o vi =20 [root@cnprodftp02 root]# grep prftp /etc/passwd | sort -n +2 -t':' | head -2 xmit:x:150:204::/prftp/forwarder:/bin/bash anl:x:213:206:test user:/prftp/carriers/anl:/sbin/nologin =20 [root@cnprodftp02 root]# uname -a Linux cnprodftp02 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:52:23 EDT 2005 i686 i686 i386 GNU/Linux Sort does not work on REdhat-AS5 ; it used to work on Redhat AS-3 [root@cnprodedi01 mail]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.6 (Tikanga) [root@cnprodedi01 mail]# grep prftp /etc/passwd | sort -n +2 -t':' | head -2 sort: open failed: +2: No such file or directory [root@cnprodedi01 mail]# [root@cnprodftp02 bin]# uname -a Linux cnprodftp02 2.6.18-238.5.1.el5 #1 SMP Mon Feb 21 05:52:39 EST 2011 x86_64 x86_64 x86_64 GNU/Linux Thanks. Jay Patel Systems Administrator INTTRA +1 973.265.2263 Office=20 +1 973.641.0510 Mobile=20 +1 973.263.5969 Fax www.inttra.com =20 This e-mail and any attachments thereto are intended only for use by the ad= dressee(s) named herein and may contain proprietary and/or confidential inf= ormation. If you are not the intended recipient of this e-mail, you are her= eby notified that any dissemination, distribution or copying of this e-mail= , and any attachments thereto, is strictly prohibited. If you have received= this e-mail in error, please immediately notify Postmaster@INTTRA.com and = permanently delete the original, any attachments, any copies thereof, and a= ny printouts thereof. ------_=_NextPart_001_01CBF55B.B3E6CBB2 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable sort command in Redhat 5 does not work

=20

[root@cnprodftp02 root]# cat /etc/red= hat-release

Red Hat Enterprise= Linux AS release 3 (Taroon Update 5)

[root@cnprodftp02 = root]# sort

[root@cnprodftp02 = root]# set -o vi

 

[root@cnprodftp02 = root]# grep prftp /= etc/passwd | sort -n +2 -t':'= | = head -2

xmit:x:150:204::/p= rftp/forwarder:/bin/bash

anl:x:213:206:test= user:/prftp/carriers/anl:/sbin/nologin

 

[root@cnprodftp02 root]# uname -a

Linux cnprodftp02 = 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:52:23 EDT 2005 i686 i686 i386 GNU/= Linux=

Sort does not wor= k on REdhat-AS5 ; it used to work on Redhat AS-3

[root@cnprodedi01 mail]# cat /etc/red= hat-release

Red Hat Enterprise= Linux Server release 5.6 (Tikanga)

[root@cnprodedi01 = mail]# grep prftp /etc/passwd | sort -n +2 -t':' | head -2

sort: open failed:= +2: No such file or directory

[root@cnprodedi01 = mail]#

[root@cnprodftp02 bin]# uname -a

Linux cnprodftp02 = 2.6.18-238.5.1.el5 #1 SMP Mon Feb 21 05:52:39 EST 2011 x86_64 x86_64 x86_64= GNU/Linux

Thanks.
Jay Patel
Systems Administrator
INTTRA
+1 973.265.2263 Office
+1 973.641
www.inttra.com




This e-mail and any attachments thereto are intended only for use by the ad= dressee(s) named herein and may contain proprietary and/or confidential inf= ormation. If you are not the intended recipient of this e-mail, you are her= eby notified that any dissemination, distribution or copying of this e-mail= , and any attachments thereto, is strictly prohibited. If you have received= this e-mail in error, please immediately notify Postmaster@INTTRA.com and = permanently delete the original, any attachments, any copies thereof, and a= ny printouts thereof. ------_=_NextPart_001_01CBF55B.B3E6CBB2-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 17:13:03 2011 Received: (at 8442-done) by debbugs.gnu.org; 7 Apr 2011 21:13:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7wVi-0001Me-NE for submit@debbugs.gnu.org; Thu, 07 Apr 2011 17:13:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7wVg-0001MA-5A for 8442-done@debbugs.gnu.org; Thu, 07 Apr 2011 17:13:01 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p37LCrSx023479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Apr 2011 17:12:54 -0400 Received: from [10.3.113.117] (ovpn-113-117.phx2.redhat.com [10.3.113.117]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p37LCqVh007910; Thu, 7 Apr 2011 17:12:53 -0400 Message-ID: <4D9E28D3.5010204@redhat.com> Date: Thu, 07 Apr 2011 15:12:51 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jyotin Patel Subject: Re: bug#8442: sort command in Redhat 5 does not work References: In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA0F7F5F38370B51E892A9725" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -10.2 (----------) X-Debbugs-Envelope-To: 8442-done Cc: 8442-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.2 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA0F7F5F38370B51E892A9725 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 04/07/2011 01:40 PM, Jyotin Patel wrote: >=20 > Sort does not work on REdhat-AS5 ; it used to work on Redhat AS-3 > [root@cnprodedi01 mail]# cat /etc/redhat-release > Red Hat Enterprise Linux Server release 5.6 (Tikanga) > [root@cnprodedi01 mail]# grep prftp /etc/passwd | sort -n +2 -t':' | > head -2 > sort: open failed: +2: No such file or directory Thanks for the report. However, this is not a bug in sort, but a misunderstanding on your part about changes to sort syntax as POSIX has evolved over the years. From the NEWS file: A few usages still have behavior that depends on which POSIX standard i= s being conformed to, and portable applications should beware these problematic usages. These include: Problematic Standard-conforming replacement, depending on usage whether you prefer the behavior of: POSIX 1003.2-1992 POSIX 1003.1-2001 sort +4 sort -k 5 sort ./+4 See also 'info coreutils standards' for information on how to set _POSIX2_VERSION=3D199209 for the behavior you were expecting. But in general, the old +2 syntax should be converted to the newer POSIX-compliant -k3 (or even the safer -k3,3) instead. Newer coreutils (the latest is 8.10) added a --debug option, to help in that: $ echo hi | _POSIX2_VERSION=3D199209 sort -n +2 -t: --debug sort: using `en_US.UTF-8' sorting rules sort: obsolescent key `+2' used; consider `-k 3' instead sort: key 1 is numeric and spans multiple fields hi ^ no match for key __ --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigA0F7F5F38370B51E892A9725 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNnijTAAoJEKeha0olJ0NqcyUIAIP97ToLlQGWLCMhGy91evmk XC6K5jtRCBqMKRjbr82kO3OD7iMn8J3fpTYYNNhvLPXN16a0AlDN9Zx4KDaGs0TS pO3i7ptQT05RQkB8jBBSkZTCeO2LrBQu5V8tq9VoqlgRl50r0R+250rOzw70EQeb WKHBjofhFAe5Lv0xQXn09ChoTSXyFXgB0/LxSG2LjAduyJVek++U0fIIwY13a3l0 1+23sY+iUyQWzZBZATVORa9OGhGsBqBfhSJ8zAGyuPige/4sMhA4AWA8Y6lmy4rM IhzOvJ3BA4eDcXoF7GDv13Qh21cyAxXtJTjwRdl7gYOmk50ldyteL1zapro5G6w= =N/bw -----END PGP SIGNATURE----- --------------enigA0F7F5F38370B51E892A9725-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 17:19:58 2011 Received: (at 8442) by debbugs.gnu.org; 7 Apr 2011 21:19:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7wcQ-0001WI-DI for submit@debbugs.gnu.org; Thu, 07 Apr 2011 17:19:58 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7wcN-0001W3-DG; Thu, 07 Apr 2011 17:19:56 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 7536E21639; Thu, 7 Apr 2011 15:19:48 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 530762DC56; Thu, 7 Apr 2011 15:19:48 -0600 (MDT) Date: Thu, 7 Apr 2011 15:19:48 -0600 From: Bob Proulx To: Jyotin Patel Subject: Re: bug#8442: sort command in Redhat 5 does not work Message-ID: <20110407211948.GA9094@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 8442 Cc: 8442@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) retitle 8442 coreutils 5.90 (2005-09-29) drops support for +N option usag= e tags 8442 + moreinfo notabug thanks Jyotin Patel wrote: > [root@cnprodftp02 root]# grep prftp /etc/passwd | sort -n +2 -t':' | he= ad -2 > xmit:x:150:204::/prftp/forwarder:/bin/bash > anl:x:213:206:test user:/prftp/carriers/anl:/sbin/nologin You are using obsolete options that are not portable. The +2 and -2 options are problematic. Don't use them. > Sort does not work on REdhat-AS5 ; it used to work on Redhat AS-3 >=20 > [root@cnprodedi01 mail]# cat /etc/redhat-release > Red Hat Enterprise Linux Server release 5.6 (Tikanga) > [root@cnprodedi01 mail]# grep prftp /etc/passwd | sort -n +2 -t':' | he= ad -2 > sort: open failed: +2: No such file or directory That is correct. This is documented in the NEWS file. Major changes in release 5.90 (2005-09-29) [unstable] A few usages still have behavior that depends on which POSIX standar= d is being conformed to, and portable applications should beware these problematic usages. These include: =20 Problematic Standard-conforming replacement, depending on usage whether you prefer the behavior of: POSIX 1003.2-1992 POSIX 1003.1-2001 sort +4 sort -k 5 sort ./+4 tail +4 tail -n +4 tail ./+4 tail - f tail f [see (*) below] tail -c 4 tail -c 10 ./4 tail -c4 touch 12312359 f touch -t 12312359 f touch ./12312359 f uniq +4 uniq -s 4 uniq ./+4 =20 (*) "tail - f" does not conform to POSIX 1003.1-2001; to read standard input and then "f", use the command "tail -- - f". =20 These changes are in response to decisions taken in the January 2005 Austin Group standardization meeting. For more details, please see "Utility Syntax Guidelines" in the Minutes of the January 2005 Meeting http://www.opengroup.org/austin/docs/austin_239.html. Also the coreutils info manual has the following documentation. The gnu utilities normally conform to the version of POSIX that is standard for your system. To cause them to conform to a different version of POSIX, define the _POSIX2_VERSION environment variable to a value of the form yyyymm specifying the year and month the standard was adopted. Two values are currently supported for _POSIX2_VERSION: =E2=80=98199209=E2=80=99 stands for POSIX 1003.2-199= 2, and =E2=80=98200112=E2=80=99 stands for POSIX 1003.1-2001. For example, = if you have a newer system but are running software that assumes an older version of POSIX and uses =E2=80=98sort +1=E2=80=99 or =E2=80=98tail = +10=E2=80=99, you can work around any compatibility problems by setting =E2=80=98_POSIX2_VERSION=3D199209=E2=80=99 in your environment. See also this FAQ entry: http://www.gnu.org/software/coreutils/faq/#Old-tail-plus-N-syntax-now-f= ails Instead of: > grep prftp /etc/passwd | sort -n +2 -t':' | head -2 Use something like this instead: $ sort -t : -k 3n,3 /etc/passwd | head -n 20 Bob From unknown Wed Jun 25 10:48:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 06 May 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator