From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LXwNw-0000n2-Dk for mharc-grub-devel@gnu.org; Fri, 13 Feb 2009 06:39:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXwNu-0000mg-Pj for grub-devel@gnu.org; Fri, 13 Feb 2009 06:39:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXwNt-0000lE-6g for grub-devel@gnu.org; Fri, 13 Feb 2009 06:39:06 -0500 Received: from [199.232.76.173] (port=48483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXwNt-0000lA-2C for grub-devel@gnu.org; Fri, 13 Feb 2009 06:39:05 -0500 Received: from mail-bw0-f208.google.com ([209.85.218.208]:51728) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXwNs-00072A-Lt for grub-devel@gnu.org; Fri, 13 Feb 2009 06:39:04 -0500 Received: by bwz4 with SMTP id 4so2261488bwz.18 for ; Fri, 13 Feb 2009 03:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=zVagoLteG7PnA76hy3gbxfALAq/tDawV6rPptjrsUEc=; b=UO/S1TD+212ZLFtt1EUa/HgTDtkuj0Uib6675xjPNab+yXHz0d2dbBbeCN7YiUOvOP w5udCF4tSYB/amNh8ga3IM4azTjk7XGLfB5Sbmv9DdruioJYhoPuh1w2VveaZvGifC6K osYP2USP0wellK01O1zF8SSuUKp+V3KCeUTtk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=hps+8jAATbqgKM7RlU7vB7bBCld3axMTUKoJxfEpjoLR3SzJXz/OtSk1EPGB2QJsuL wGQoAkNXqeotEbZPilaWe+kEKRuyyArbG2pI8QghY9IM2A+XDPYj8RI8rTXK1ZU672Py 9xsz28ISsrMA1AX+ooJbdVZFx9Zmf4t6r0VrM= Received: by 10.86.33.10 with SMTP id g10mr199140fgg.47.1234525143310; Fri, 13 Feb 2009 03:39:03 -0800 (PST) Received: from ?192.168.1.25? (120-197.62-81.cust.bluewin.ch [81.62.197.120]) by mx.google.com with ESMTPS id 3sm1159448fge.52.2009.02.13.03.39.02 (version=SSLv3 cipher=RC4-MD5); Fri, 13 Feb 2009 03:39:02 -0800 (PST) Message-ID: <49955BD7.2070206@gmail.com> Date: Fri, 13 Feb 2009 12:39:03 +0100 From: phcoder User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Test command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 11:39:06 -0000 Hello. Here is an implementation of bash-like "test" command. Many file tests are omitted because they are useless in grub (e.g. -c test). I also added 3 extension: lexicographical comparing, prefixed -gt and -lt (it skips common prefix. Useful for comparing versions. e.g. [ vmlinuz-3 -plt vmlinuz-11 ] is true) and biased -nt/-ot which adds s specified amount of seconds to mtime. Regards Vladimir 'phcoder' Serbinenko