<div dir="ltr"><div>There's probably a GRUB-specific mailing list or forum, but I thought I would try here first ...</div><div><br></div><div>GRUB has a DSL ( <a href="https://en.wikipedia.org/wiki/Domain-specific_language">https://en.wikipedia.org/wiki/Domain-specific_language</a> ) that looks a lot like shell scripting.  Most people never see it as it's used to generate the menus we use at boot-time and they see only the menus, but it can do some interesting things - particularly when you're dealing with multi-boot USB sticks.  Here's a simple but slightly useful example:</div><div><br></div><div>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 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></div><div><br></div><div>But it has some nasty limitations that are frustrating me:</div><div>- no pipes</div><div>- no command substitution</div><div>- no file globbing</div><div><br></div><div>That last in particular is really getting on my nerves.  I want to source all the files in one folder, but I can't say 'for file in folder/* ; do' because the '*' is a literal character, no special meaning.  Likewise, I can't say 'for file in `ls folder/` ; do' because there's no command substitution.</div><div><br></div><div>I was wondering if anyone knows of a solution to this problem.  Or even if you have ideas from long-gone old shells with similar limitations for which someone worked out a nasty work-around ...  What I've been doing is 'for file in name1 name2 name3 ... ; do', but of course this only works if you remember to add new filenames to the list.<br></div><div><br></div><div>I've googled quite a bit, but most people only modify GRUB through /etc/default/grub or, if they're really adventurous, through /etc/grub.d/40_custom or similar.  What I'm looking for is (mostly) at a lower level than that, and examples are surprisingly hard to come by.  And search results are occasionally polluted by GRUB4DOS results ... GRUB4DOS _does_ seem to support file globbing.  All very confusing.  Thanks.<br></div><div><br>-- <br><div class="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>