Increment numeric value of configuration setting

Synopsis

  inc <setting> [<increment>]

Examples

Increment a numeric value

  iPXE> set x:int32 5
  iPXE> inc x
  iPXE> show x
  x:int32 = 6

Iterate over all network devices

  #!ipxe
  set idx:int32 0
  :loop isset ${net${idx}/mac} || goto loop_done
    echo net${idx} is a ${net${idx}/chip} with MAC ${net${idx}/mac}
    inc idx && goto loop
  :loop_done

Description

Increment the numeric value of the specified configuration setting by the specified increment amount. If no increment amount is explicitly specified, the value will be incremented by one.

If the specified configuration setting does not exist, then it will be treated as having an initial value of zero.

Command status

Success The configuration setting was incremented successfully
Failure The configuration setting was not incremented successfully

See also

cmd/inc.txt ยท Last modified: 2013/08/01 14:50 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.