Using VMS DCL command scripts one can catch errors by using the on error
command:
$ on error then goto MyErrorHandler
$ directory samiam.txt
$ delete x.txt
$ exit
$MyErrorHandler:
$ print "Something."
How does one do this in Linuxland?
In the example an error with directory
or delete
will cause control to go to MyErrorHandler
.