⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trap.err

📁 UNIX+shell范例精解(第4版)代码
💻 ERR
字号:
#!/bin/ksh# This trap checks for any command that exits with a non-zero 	# status and then prints the message.trap 'print "You gave me a non-integer. Try again. "' ERRtypeset -i number     # Assignment to number must be integerwhile truedo    print -n "Enter an integer. "     read -r number 2> /dev/null    if (( $? == 0 ))     # Was an integer read in?     then                 # Was the exit status zero?        break     fidonetrap - ERR           # Unset pseudo trap for ERRn=$numberif grep ZOMBIE /etc/passwd > /dev/null 2>&1then 	:  else    print "\$n is $n. So long"fi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -