From rock-devel-bounces@rocklinux.org Sat Nov 18 14:08:18 2006 Return-Path: X-Original-To: lurker-pieSim9l-rock-devel@localhost.localnet Delivered-To: lurker-pieSim9l-rock-devel@localhost.localnet Received: from phoenix.clifford.at (localhost [127.0.0.1]) by phoenix.clifford.at (Postfix) with ESMTP id 8DD6E93CFB; Sat, 18 Nov 2006 14:08:18 +0100 (CET) X-Original-To: rock-devel@rocklinux.org Delivered-To: rock-devel@rocklinux.org Received: from email.uni-linz.ac.at (email.edvz.uni-linz.ac.at [140.78.3.58]) by phoenix.clifford.at (Postfix) with ESMTP id 67F3993CF4 for ; Sat, 18 Nov 2006 14:08:17 +0100 (CET) Received: from heim-034-235.raab-heim.uni-linz.ac.at (heim-034-235.raab-heim.uni-linz.ac.at [193.171.34.235]) by email.uni-linz.ac.at (Postfix) with ESMTP id 2DD6343EC13 for ; Sat, 18 Nov 2006 14:07:30 +0100 (CET) Received: from (heim-034-235.raab-heim.uni-linz.ac.at [193.171.34.235]) by gwavraab.uni-liny.ac.at with smtp id 0c83_fd63af7c_7705_11db_9588_001143d314e3; Sat, 18 Nov 2006 13:09:14 +0000 From: Stefan Fiedler To: ROCK Development Mailing List Date: Sat, 18 Nov 2006 14:07:35 +0100 User-Agent: KMail/1.9.5 References: <4559FB74.2090301@fastwebnet.it> <200611172233.57204.stefan.fiedler@students.jku.at> <455EB9A5.1020900@fastwebnet.it> In-Reply-To: <455EB9A5.1020900@fastwebnet.it> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200611181407.35983.stefan.fiedler@students.jku.at> Subject: Re: [rock-devel] Troubles in a multiple choice X-BeenThere: rock-devel@rocklinux.org X-Mailman-Version: 2.1.6 Precedence: list Reply-To: ROCK Development Mailing List List-Id: ROCK Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: rock-devel-bounces@rocklinux.org Errors-To: rock-devel-bounces@rocklinux.org On Saturday 18 November 2006 08:43, Luca wrote: > Hi and good morning Stefan! > > I tried with the examples you gave and by adding the """ after > SUPPORTED-LOCALES and inserting it in the last line provokes a file too > long. Good morning! Did you also change SUPPORTED-LOCALES to SUPPORTED_LOCALES ? Remember the former is not a valid variable name in bash and will cause an error when evaluating SUPPORTED like this: . SUPPORTED > I tried the other option and it effectively displays the entries in > bash, but there are even the double identifications (I added a | cut -d/ > -f1,2 after done): > it_CH.UTF-8/UTF-8 it_CH.UTF-8 > it_CH/ISO-8859-1 it_CH > it_IT.UTF-8/UTF-8 it_IT.UTF-8 > it_IT/ISO-8859-1 it_IT > it_IT@euro/ISO-8859-15 it_IT@euro > > In this way (just tried) when choosing the locales it saves, example as > "it_IT.UTF-8.UTF-8" which obviously is not recognized. > Obvious question, how do I manage now to remove the double "/" > from the first $x? > (The first part should look exactly as the second, so it should looks > like it_IT.UTF-8 it_IT.UTF-8) > > Thanks for efforts, patience, etc... > > Luca As always, there are several ways to do this. Try the following: grep -A9999 "SUPPORTED-LOCALES" SUPPORTED | \ while read -r x y ; do echo ${x%%/*} ${x%%/*} ; done ${x%%pattern} evaluates to x, with the longest possible pattern removed from the end. You could also use, with the same result: grep -A9999 "SUPPORTED-LOCALES" SUPPORTED | \ cut -f1 -d/ | while read -r x y ; do echo $x $x ; done Tip: I usually test such code on the command line before I use it in ROCK scripts. That way debugging is much easier :) With best regards, Stefan Fiedler P.S: I'll be AFK for this weekend and might not be able to answer questions until Monday. _______________________________________________ rock-devel mailing list rock-devel@rocklinux.org http://www.rocklinux.net/mailman/listinfo/rock-devel