Purpose

With no arguments, print the state of lamp 1. With an
argument, change the state of lamp 1 to "on" or "off"

Usage

lamp1 [state]

Arguments

state = action to take on lamp; legal values are

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

Output

The current or new state of the lamp is printed to stdout.

Exit values

0 = normal completion
1 = wrong number of arguments

Example

1) Show status of lamp 1

lamp1

2) Turn lamp 1 on

lamp1 on

3) Turn lamp 1 off

lamp1 off