Purpose

With one arguments, show the status of the specified lamp.
With two arguments, change the state of the specified lamp to
"on" or "off", depending on the argument.

Usage

lampnum n [state]

Arguments

n = index number of the specified lamp

state = action to take on lamp; legal values are

"0" or "off" = off
"1" or "on" = on

Output

The new state for the specified lamp is printed to stdout.

Restrictions


Exit values

0 = normal completion
1 = wrong number of arguments
2 = lamp number out of range
3 = illegal state specified

Example

1) Show status of lamp 1

lampnum 1

2) Turn lamp 1 on

lampnum 1 on

3) Turn lamp 1 off

lampnum 1 off