.TH  LASTERROR "" "" "Environmental Variable"
.PC "Program that last generated an error"
\fBLASTERROR=\fIprogram name\fR
.PP
The environmental variable
.B LASTERROR
names the last program to have returned an error to the shell.
For example, if you had used the command
.B set
with an incorrect number of arguments, it would have failed to
run and would have exited with an error condition, and
.B LASTERROR
would read
.BR "LASTERROR=set" .
.PP
The command
.B help
reads
.B LASTERROR
to determine what the last program was for which you needed help.
Thus, if you type
.B help
without an argument, it will return information about the program
named in
.BR LASTERROR .
.SH "See Also"
.Xr "environmental variables" environva
