[Top][All Lists]

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

Re: [PATCH] Test for files with ls

From: Robert Millan
Subject: Re: [PATCH] Test for files with ls
Date: Sat, 12 Jul 2008 16:27:07 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

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 /.)

reply via email to

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