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
_______________________________________________
gPXE mailing list
[email protected]
http://etherboot.org/mailman/listinfo/gpxe

Reply via email to