什么是用于VMS DCL“ ON ERROR”的Linux?


8

使用VMS DCL命令脚本,可以使用以下on error命令捕获错误:

$ on error then goto MyErrorHandler
$ directory samiam.txt
$ delete x.txt
$ exit
$MyErrorHandler:
$ print "Something."

在Linuxland中如何做到这一点?

在此示例中,directory或错误delete将导致控制权转到MyErrorHandler

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.