From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1InxAh-0000A0-DV for garchives@archives.gentoo.org; Fri, 02 Nov 2007 14:06:51 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id lA2E601e002195; Fri, 2 Nov 2007 14:06:00 GMT Received: from mail.marples.name (rsm.demon.co.uk [80.177.111.50]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id lA2E43Bi032252 for ; Fri, 2 Nov 2007 14:04:03 GMT Received: from [10.73.1.31] (uberlaptop.marples.name [10.73.1.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id AA72419010B for ; Fri, 2 Nov 2007 14:04:02 +0000 (GMT) Subject: Re: [gentoo-dev] More general interface to use flags From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <472B29B9.50002@gentoo.org> References: <472B29B9.50002@gentoo.org> Content-Type: text/plain Organization: Gentoo Date: Fri, 02 Nov 2007 14:04:01 +0000 Message-Id: <1194012241.16055.11.camel@uberlaptop.marples.name> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 9249828f-b2e8-48b1-b483-b1af804b2085 X-Archives-Hash: bea40bf3407df27802a2bea9baf39122 On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: > [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } Could be written as [ "${flag#!}" != "${flag}" ] && { success=1; flag=${flag#!}; } > string=$( (( ${success} == 0 )) && echo ${string_success} || echo > ${string_failure} ) > [[ -n ${string} ]] && echo ${string} if [ "${success}" = "0" ]; then string=${string_success} else string=${string_failure} fi [ -n "${string}" ] && echo "${string}" Thanks Roy -- gentoo-dev@gentoo.org mailing list