Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4842677
  • 博文数量: 930
  • 博客积分: 12070
  • 博客等级: 上将
  • 技术积分: 11448
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-15 16:57
文章分类

全部博文(930)

文章存档

2011年(60)

2010年(220)

2009年(371)

2008年(279)

分类:

2009-03-30 10:46:43

cat menu
#!/bin/bash

#name menu

MYDATE=`date +%d/%m/%Y`
THIS_HOST=`hostname -s`
USER=`whoami`

while :
do
  tput clear
  cat <<MAYDAY

-----------------------------------------------------------------------------
User: $USER Host:$THIS_HOST Date:$MYDATE
-----------------------------------------------------------------------------
            1: List files in current directory
            2: Use the vi editor
            3: See who is on the system
            H: Help screen
            Q: EXIT Menu
-----------------------------------------------------------------------------
MAYDAY
echo -e -n "\tYour Choice [1,2,3,H,Q] >"
read CHOICE
  case $CHOICE in
  1) ls
    ;;
  2) vi
    ;;
  3) who
    ;;
  H|h)
     cat << MAYDAY
    This is the help screen ,nothing here yet to help
MAYDAY
      ;;
  Q|q) exit 0
    ;;
  *) echo -e "\t\007unknown user response"
    ;;
  esac
echo -e -n "\tHit the return key to continue"
read DUMMY
done

./menu


-----------------------------------------------------------------------------
User: root Host:localhost Date:29/03/2009
-----------------------------------------------------------------------------
            1: List files in current directory
            2: Use the vi editor
            3: See who is on the system
            H: Help screen
            Q: EXIT Menu
-----------------------------------------------------------------------------
        Your Choice [1,2,3,H,Q] >

阅读(1277) | 评论(0) | 转发(0) |
0

上一篇:CentOS5.2 ntfs-3g mount ntfs

下一篇:设置vim折叠

给主人留下些什么吧!~~