专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell脚本编程实例>

一个简单的目录菜单

百度收藏 QQ搜藏

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
done

上一篇:sort实例应用 下一篇:一个.cshrc例子

power by soyo123 2007-2008