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: [email protected] [mailto:[email protected]] On Behalf Of Jason But Sent: Tuesday, September 06, 2011 8:03 PM To: Leslie Rhorer Cc: [email protected] 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: [email protected] > [mailto:[email protected]] On Behalf Of Jason > But > Sent: Tuesday, September 06, 2011 2:50 AM > To: [email protected] > 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 [email protected] https://lists.gnu.org/mailman/listinfo/help-grub _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
