QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 683|回复: 0

看看这段shell script 为什么不能运行?:~~

[复制链接]
发表于 2003-4-22 02:31:23 | 显示全部楼层 |阅读模式
[code:1]
#!/bin/sh
#Copy this script from book "Linux Shell".
#       Standard AT&T Bourne Shell Script.
#       The party program -- Invitations to friends from
#    the 'guest' file.
#

guestfile=./guests
if [ ! -f "$guestfile" ]
then
  echo "'basename $guestfile' non-existent"
  exit 1
fi

PLACE="$USER's"
export PLACE

Time='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
    # 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 $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,
                Ivn@'hostname'
    FINIS
    shift
    if [ $# -eq 0 ]
    then
      set cheese crackers shrimp drinks "hot dogs" sandwiches
    fi
  fi
done
echo "Bye ..."
[/code:1]
//
##./party.sh: line 49: syntax error: unexpected end of file
[/code]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-16 02:23 , Processed in 0.042486 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表