Board logo

标题: shell编程例子 -- 一个简单的目录菜单 [打印本页]

作者: 网普科技     时间: 2005-6-16 03:02 PM    标题: shell编程例子 -- 一个简单的目录菜单

until
    echo List Directory..........1
    echo Change Directory........2
    echo Edit File...............3
    echo Remove File.............4
    echo Exit Menu...............5

    read choice
    test $choice = 5
    do
    case $choice in
    1) ls;;
    2) echo Enter target directory
    read dir
    cd $dir
    ;;
    3) echo Enter file name
    read file
    vi $file
    ;;
    4) echo Enter file name
    read file
    rm $file
    ;;
    q|Q|5) echo Goodbye;;
    *) echo illegal Option
    esac


    原作者: 不详
    来 源: 不详




欢迎光临 网普技术论坛 (http://bbs.netpu.net/) Powered by Discuz! 2.5