[gPXE] fall-back filename
Miller, Shao
Shao.Miller at yrdsb.edu.on.ca
Thu Apr 8 07:46:27 EDT 2010
Good day Alexander,
I'm glad that crazy scripting library worked for you.
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
- Shao Miller
More information about the gPXE
mailing list