From owner-freebsd-proliant@FreeBSD.ORG Wed Mar 21 13:45:58 2007 Return-Path: X-Original-To: freebsd-proliant@FreeBSD.ORG Delivered-To: freebsd-proliant@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A68C16A420 for ; Wed, 21 Mar 2007 13:45:58 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id DC90D13C46C for ; Wed, 21 Mar 2007 13:45:55 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ajchob@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l2LDOIah075483; Wed, 21 Mar 2007 14:24:23 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l2LDOHg4075482; Wed, 21 Mar 2007 14:24:17 +0100 (CET) (envelope-from olli) Date: Wed, 21 Mar 2007 14:24:17 +0100 (CET) Message-Id: <200703211324.l2LDOHg4075482@lurza.secnetix.de> From: Oliver Fromme To: freebsd-proliant@FreeBSD.ORG, soren@klintrup.dk In-Reply-To: <45D25504.6020500@klintrup.dk> X-Newsgroups: list.freebsd-proliant User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 21 Mar 2007 14:24:23 +0100 (CET) Cc: Subject: Re: HP Proliant SmartArray nagios check X-BeenThere: freebsd-proliant@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-proliant@FreeBSD.ORG, soren@klintrup.dk List-Id: "Technical discussion of FreeBSD on HP ProLiant server platforms." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2007 13:45:58 -0000 Søren Klintrup wrote: > Edwin Groothuis wrote: > > [...] > > To overcome the problem of many of [Tt][Hh][Ee][Ss][Ee] kind of > > string, you can pipe the output through tr(1) so that it at least > > is human-readable (instead of the minimal requirement of being a > > cyborg :-) > > > > [~] edwin@k7>echo "TtHhEeSsEe" | tr A-Z a-z > > tthheessee > [...] > As for using 'i' as an option on sed, it doesn't seem to work on FreeBSD > 6.2 (havn't tested on others, since theres no reason if it doesn't work > on 6.2 :), sed doesn't support the "i" option for regexps (I think it's an extension of gnu-sed only). > the tr A-Z a-z worked like a charm though, and it's readable > again. Very careful here. Character rages like the above are locale-dependant. They are only guaranteed to work as expected in the C locale. Try this: $ export LANG=lt_LT.ISO8859-4 $ echo FOOBAR | tr A-Z a-z f¿¿baq Therefore character ranges should be avoided in scripts. They break for people with certain locale settings. The portable solution is to use character classes: $ echo FOOBAR | tr '[:upper:]' '[:lower:]' foobar Details can be found in the tr(1) manual page which explains the problem with A-Z a-z. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The scanf() function is a large and complex beast that often does something almost but not quite entirely unlike what you desired." -- Chris Torek From owner-freebsd-proliant@FreeBSD.ORG Fri Mar 23 19:26:48 2007 Return-Path: X-Original-To: freebsd-proliant@FreeBSD.ORG Delivered-To: freebsd-proliant@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D51716A403 for ; Fri, 23 Mar 2007 19:26:48 +0000 (UTC) (envelope-from soren@klintrup.dk) Received: from mail01.hemligt.net (mail01.hemligt.net [87.48.247.181]) by mx1.freebsd.org (Postfix) with ESMTP id 318B313C4B0 for ; Fri, 23 Mar 2007 19:26:47 +0000 (UTC) (envelope-from soren@klintrup.dk) Received: from localhost (unknown [172.21.203.81]) by mail01.hemligt.net (Postfix) with ESMTP id EFF8D325448; Fri, 23 Mar 2007 20:05:13 +0100 (CET) X-Virus-Scanned: amavisd-new at hemligt.net Received: from mail01.hemligt.net ([172.21.203.81]) by localhost (mail01.hemligt.net [172.21.203.81]) (amavisd-new, port 10024) with ESMTP id 2Z5ROiVKRFEn; Fri, 23 Mar 2007 20:05:06 +0100 (CET) Received: from [172.21.203.26] (unknown [172.21.203.26]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01.hemligt.net (Postfix) with ESMTP id 638463250D8; Fri, 23 Mar 2007 20:05:06 +0100 (CET) Message-ID: <460424EB.8020401@klintrup.dk> Date: Fri, 23 Mar 2007 20:05:15 +0100 From: =?ISO-8859-1?Q?S=F8ren_Klintrup?= User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: freebsd-proliant@FreeBSD.ORG, soren@klintrup.dk References: <200703211324.l2LDOHg4075482@lurza.secnetix.de> In-Reply-To: <200703211324.l2LDOHg4075482@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: HP Proliant SmartArray nagios check X-BeenThere: freebsd-proliant@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion of FreeBSD on HP ProLiant server platforms." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2007 19:26:48 -0000 Oliver Fromme wrote: > Very careful here. Character rages like the above are > locale-dependant. They are only guaranteed to work as > expected in the C locale. Try this: > > $ export LANG=lt_LT.ISO8859-4 > $ echo FOOBAR | tr A-Z a-z > f¿¿baq > > Therefore character ranges should be avoided in scripts. > They break for people with certain locale settings. > The portable solution is to use character classes: > > $ echo FOOBAR | tr '[:upper:]' '[:lower:]' > foobar > > Details can be found in the tr(1) manual page which > explains the problem with A-Z a-z. Thanks a lot, I read the manpage and changed the script accordingly :). Regards, Søren