[gPXE] fall-back filename
Michael Brown
mbrown at fensystems.co.uk
Thu Apr 8 23:52:33 EDT 2010
On Thursday 08 Apr 2010 12:46:27 Miller, Shao wrote:
> For the curious, you can implement a conditional statement as follows:
>
> set dollar $
> set lb {
> set rb }
> set nop #
> # Suppose we wish to execute a line based on a non-empty "foo" setting
> set bar nop${foo:hex}
> # If "foo" was empty, "bar" is simply "nop"
> # If "foo" was set to anything, "bar" is "nopXX"
> # Now we wrap "bar" with the expansion sequence
> set bar:hex ${dollar:hex}:${lb:hex}:${bar:hex}:${rb:hex}
> # If "foo" was empty, "bar" is now "${nop}"
> # If "foo" was set, "bar" is now "${nopXX}"
> ${bar} echo foo was set.
> # The above thus expands to a comment is "foo" was empty
> # or to " echo foo was set." if "foo" was set
*applause*
Michael
More information about the gPXE
mailing list