Classic shell source (1)

xiaoxiao2021-03-06  42

#! / bin / tcsh -f

# Gnu tc shell

# The party program - invitations to friends from the "guest" File

Set guestfile = ./guests # ~ / shell / guests

IF (! -e "$ guestfile") THEN

Echo "$ GUESTFILE: T NON-EXISTENT"

EXIT 1

ENDIF

Stenv Place "Sarotini's"

@ Time = `Date % h` 1

Set food = (Cheese Crackers Shrimp Drinks "Hot Dogs" SANDWICHES)

Foreach Person (`Cat $ GuestFILE`)

IF ($ Person = ~ root) Continue

# Start of Here Document

Mail -v -s "party" $ PERSON << 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 $ food [1] and

Anything else you 10th Like to Eat? Let me know if you can't

Make it. Hope to see you soon.

Your Pal,

Ellie @ `Hostname` # or` uname -n`

Finis

SHIFT FOOD

IF ($ # food == 0) THEN

Set food = (Cheese Crackers Shrimp Drinks "Hot Dogs"

SANDWICHES)

ENDIF

end

echo "Bye ..."

转载请注明原文地址:https://www.9cbs.com/read-117747.html

New Post(0)