[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] Test for files with ls

From: Lampersperger Andreas
Subject: RE: [PATCH] Test for files with ls
Date: Mon, 14 Jul 2008 08:32:00 +0200

Hello Robert,

My experience showed me that a 'source' - command is not allowed to
fail. In my grub.cfg is a 'source'-command which includes a
grub.cfg.gfx. If I delete the grub.cfg.gfx also the grub.cfg is rejected
and grub boot's as if there were no grub.cfg at all.

I tested this with GRUB 1.96


-----Original Message-----
From: address@hidden
On Behalf Of Robert Millan
Sent: Saturday, July 12, 2008 4:27 PM
To: The development of GRUB 2
Subject: Re: [PATCH] Test for files with ls

On Mon, Jul 07, 2008 at 09:46:58AM +0200, Lampersperger Andreas wrote:
> Hi,
> I have there a small patch to commands/ls.c, whichs makes the 
> ls-command return an error for non existing fils (as the bash ls 
> command).
> With this patch, one can have in the grub.cfg files statements like:
> if ls /boot/grub/grub.cfg.gfx ; then
>     source /boot/grub/grub.cfg.gfx
> fi

You don't need this kind of protection.  Your script is equivalent to:

  source /boot/grub/grub.cfg.gfx

because commands are (intentionaly) allowed to fail.  Is there another
use case for your proposed change?  (if not, I think it's better not to
add it; we don't need to implement every feature in coreutils/bash).

Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call... if you are unable to speak?
(as seen on /.)

Grub-devel mailing list

Registergericht: Traunstein / Registry Court: HRB 275 – Sitz / Head Office: 
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Geschäftsführung / Management Board: Thomas Sesselmann (Vorsitzender / 
Michael Grimm, Rainer Hagl, Matthias Fauser

E-Mail Haftungsausschluss / E-Mail Disclaimer:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]