ex_1.8
来自「Advanced Bash− Scripting Guide An 」· 8 代码 · 共 42 行
8
42 行
#!/bin/ksh # The Party Program--Invitations to friends from the # "guest" file #guestfile=~/shell/guestsguestfile=./guestsif [[ ! -a "$guestfile" ]] then print "${guestfile##*/} non-existent" exit 1fiexport PLACE="Sarotini's"(( Time=$(date +%H) + 1))set cheese crackers shrimp drinks "hot dogs" sandwiches for person in $(< $guestfile) do if [[ $person = root ]] then continue else mail -v -s "Party" $person <<- FINIS # Start of here document 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't make it. Hope to see you soon. Your pal, ellie@`hostname`FINIS shift if (( $# == 0 )) then set cheese crackers shrimp drinks "hot dogs" sandwiches fi fidone print "Bye..."
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?