Unix Shell编程权威指南的配套源代码,书是好书,不过习题没有答案,要自己做了

源代码在线查看: trap.err

软件大小: 137 K
上传用户: kinder121
关键词: Shell Unix 编程 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/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. "' ERR				typeset -i number     # Assignment to number must be integer				while true				do				    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 				    fi				done				trap - ERR           # Unset pseudo trap for ERR				n=$number				if grep ZOMBIE /etc/passwd > /dev/null 2>&1				then				 	:  				else				    print "\$n is $n. So long"				fi							

相关资源