help-grub
[Top][All Lists]
Advanced

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

RE: Looping through files


From: Leslie Rhorer
Subject: RE: Looping through files
Date: Tue, 6 Sep 2011 22:50:14 -0500

My guess would be the shell included with Grub does not provide the `ls`
command.  It also may not recognize process redirection.

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Jason
But
Sent: Tuesday, September 06, 2011 8:03 PM
To: Leslie Rhorer
Cc: address@hidden
Subject: Re: Looping through files

Thanks for the suggestion

I just tried this but it didn't work:
 error: syntax error.
 error: incorrent command.
 error: syntax error

It seems strange that it is not possible to script looping through files on
the boot disk.

As background, what I am trying to achieve is to include menu items
dynamically based on whether certain files exist on the disk. I could do
that with "if [-e ..." as I have done and tested this to work OK. However I
don't want to have to hardcode which files I wish to check for


> 
> Have you tried:
> 
>       while read dir_name
>       do
>               echo $dir_name
>       done < <( ls /boot/* )
> 
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of Jason
> But
> Sent: Tuesday, September 06, 2011 2:50 AM
> To: address@hidden
> Subject: Looping through files
> 
> Hello all
> 
> I am trying to make a sort-of complicated grub.cfg file where I want to
> search a series of files on the disk.
> 

_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub




reply via email to

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