From owner-freebsd-questions@FreeBSD.ORG Wed Feb 1 09:52:22 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D2E7106566B for ; Wed, 1 Feb 2012 09:52:22 +0000 (UTC) (envelope-from eam1edward@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F76B8FC16 for ; Wed, 1 Feb 2012 09:52:22 +0000 (UTC) Received: by iaeo4 with SMTP id o4so2044013iae.13 for ; Wed, 01 Feb 2012 01:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=hoB8rIGvQSkLjC2lzPD3NsamcekYIPi0OlHij+IXQfk=; b=v6bx+j9uTx+xpea8Ld7QrPiBRQLAA2zrjTTcfxnxuK4sVLNH9RPnOUcIdYsb86zHWY HNac61j/uXsi0ntiCeZqtj7+EmloTehuilPouFYM89XJ3VJ1S3/YTHlApoFgzISimtVg 8Drdf+iBmlC5I11NMvyhjhVkh5rrCl/tvs7aU= Received: by 10.50.6.227 with SMTP id e3mr6013291iga.20.1328089941616; Wed, 01 Feb 2012 01:52:21 -0800 (PST) Received: from [192.168.1.101] ([174.134.109.226]) by mx.google.com with ESMTPS id ba5sm13869903igb.6.2012.02.01.01.52.20 (version=SSLv3 cipher=OTHER); Wed, 01 Feb 2012 01:52:20 -0800 (PST) Message-ID: <4F291A7A.70609@gmail.com> Date: Wed, 01 Feb 2012 02:56:58 -0800 From: Edward Martinez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Robert Bonomi References: <201201312022.q0VKMabu097278@mail.r-bonomi.com> In-Reply-To: <201201312022.q0VKMabu097278@mail.r-bonomi.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions Subject: =?windows-1252?q?Re=3A=5BSOLVED=5D_bash__LC=5FCOLLATE_or_LC=5FAL?= =?windows-1252?q?L_set_=93C=94_not__sort_in_dictionary_order=2E?= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 09:52:22 -0000 On 01/31/12 12:22, Robert Bonomi wrote: > ` > > > Edward wrote: >> On 01/31/12 06:31, Robert Bonomi wrote: >>>> Hi, >>>> >>>> Been trying to get BASH to sort set characters in dictionary order. >>>> I typed "locale" and it shows LC_COLLATE and LC_ALL are set to "C" >>>> thought that was enough to work, >>>> however when i type metacharacters: set character; any character, >>>> something like this: >>>> >>>> ls [a-cx-y]* >>>> >>>> bash does not sort in dictionary order; file "Binarc" does not >>>> list. >>>> >>> *OF*COURSE* it doesn't. Unix is _case_sensitive_. You specified a lower- >>> case only (in the C locale) pattern. Naturally, it doesn't match a file >>> with an upper-case character in it. >>> >>> Note: in the 'C' locale, characters are sorted on the underlying byte value. >>> Thus you will get all the upper-case matches before any lower-case match. >>> >>> To get upper-and-lower case files in the C locale, you will have to use: >>> ls [A-CX-Ya-cx-y]* >>> >>> IF you speciy a different charset for collating, you _may_ get upper/lower >>> case characters sorted adjacently. See the specifications for the charset >>> in question. >>> >>> >> Thanks for reply! >> >> I meant LC_COLLATE being set to en_US.UTF-8 not C. > AH. you lied (not necessarily maliciously, or intentionally) about the > nature of the problem. disregard my rant. > > The short answer to the revised situation is 'it depends on how the charset > collating sequence is deifined'. AND _which_ release of FreeBSD you are > using, and thus which version of bash. > I have been digging around and discovered linux's bash is not working correctly on this matter and numerous users have file bug reports about it. FreeBSD's bash is fine: https://bugs.archlinux.org/task/24553 https://bugs.launchpad.net/ubuntu/+source/bash/+bug/120687 http://teaching.idallen.com/net2003/06w/notes/character_sets.txt i will continue using either character classes and upper/lower case charsets when defining wildcards thanks for the help.