example02.04

来自「UNIX[1].shell范例精解(第4版)_code」· 04 代码 · 共 38 行

04
38
字号
#!/bin/sh # The Party Program--Invitations to friends from the "guest" file #guestfile=/home/jody/ellie/shell/guestsguestfile=./guestsif [ ! -f "$guestfile" ] then	echo "`basename $guestfile` non-existent"	exit 1fiPLACE="Sarotini's"; 	export PLACETime=`date +%H`Time=`expr $Time + 1`set cheese crackers shrimp drinks "hot dogs" sandwiches for person in `cat $guestfile` do	if [ $person = root ] 	then		continue	else 	#	mail -v -s "Party" $person <<- FINIS 		cat <<-FINIS		Hi ${person}! Please join me at $PLACE for a party! 		Meet me at $Time o'clock.		I'll bring the ice cream. Would you please bring $1 and 		anything else you would like to eat? Let me know if you 						can make it. Hope to see you soon.				    Your pal,		    ellie@`hostname`		FINIS		shift 		if [ $# -eq 0 ] 		then		   set cheese crackers shrimp drinks "hot dogs" sandwiches		fi	fidone		echo "Bye..." 

⌨️ 快捷键说明

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