<div dir="ltr">On 25 July 2018 at 13:45, Lennart Sorensen via talk <span dir="ltr"><<a href="mailto:talk@gtalug.org" target="_blank">talk@gtalug.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Jul 25, 2018 at 12:54:39PM -0400, Giles Orr via talk wrote:<br>
> There's probably a GRUB-specific mailing list or forum, but I thought I<br>
> would try here first ...<br>
> <br>
> GRUB has a DSL ( <a href="https://en.wikipedia.org/wiki/Domain-specific_language" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>Domain-specific_language</a> )<br>
> that looks a lot like shell scripting.  Most people never see it as it's<br>
> used to generate the menus we use at boot-time and they see only the menus,<br>
> but it can do some interesting things - particularly when you're dealing<br>
> with multi-boot USB sticks.  Here's a simple but slightly useful example:<br>
> <br>
> function cpuinfo {<br>
>     # only able to determine: 32/64 bit, and is it PAE<br>
>     echo "GRUB's ability to analyse processors is limited, we can only tell<br>
> you:"<br>
>     if cpuid -p; then<br>
>         pae_assessment="PAE"<br>
>     else<br>
>         pae_assessment="NO PAE"<br>
>     fi<br>
>     if cpuid -l; then<br>
>         echo "64-bit processor, $pae_assessment"<br>
>     else<br>
>         echo "32-bit processor, $pae_assessment"<br>
>     fi<br>
> }<br>
> <br>
> But it has some nasty limitations that are frustrating me:<br>
> - no pipes<br>
> - no command substitution<br>
> - no file globbing<br>
<br>
</div></div>Actually it does file globbing if you load the regexp module.<br>
<br>
Apparently this works:<br>
<br>
insmod regexp<br>
for i in /boot/*; do echo $i; done<br>
<br>
Or:<br>
<br>
grub> ls /boot/*<br>
error: file `/boot/*' not found.<br>
grub> insmod regexp<br>
grub> ls /boot/*<br>
unicode.pf2 i386-pc/ locale/ fonts/ grubenv grub.cfg<br>
config-4.16.0-2-amd64<br>
...<span class="HOEnZb"></span><br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you!</div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't think that's documented anywhere, and it doesn't strike me as being in any way obvious.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Giles<br><a href="https://www.gilesorr.com/" target="_blank">https://www.gilesorr.com/</a><br><a href="mailto:gilesorr@gmail.com" target="_blank">gilesorr@gmail.com</a></div>
</div></div>