Table of Contents

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