Git Product home page Git Product logo

myshell's Introduction

myshell 模拟bash脚本
------------------
内部命令(由内置的函数实现):
    bg [任务号] 将后台挂起的任务继续在后台执行
    cd [目录] 跳转工作目录
    clr 清屏
    dir ([目录]) 列出(当前)目录的文件结构
    echo [参数] 输出内容
    exec [command [arguments...]] 执行命令
    exit 退出程序
    fg [任务号] 将后台挂起或运行的任务继续在前台执行
    help 帮助文档
    jobs 列出当前的所有任务
    pwd 列出当前工作目录
    set 列出所有环境变量
    test [表达式] 提供文本、整数、字符串的比较判断
    time 显示当前时间(精确到秒)
    umask ([模式]) 改变权限掩码(无参数则显示当前掩码)
------------------
外部程序调用:
    除去上述关键字外,myshell会将其他的输入视为外部程序调用:
        program arguments...
------------------
其他特性:
->  在命令(包括外部程序)末尾空格后加上 & 可以实现后台执行命令,通过任务系统提供的作业号可以执行对应的操作.
->  提供了 < 、 > 、 >> 三种重定向方式, < 用于重定向输入; > 和 >> 用于覆盖和追加的重定向输出.
->  提供了文件脚本的输入方式,在执行myshell程序时加上文件路径参数即可实现文件输入:
        ./myshell batchfile
->  提供了内部命令的管道操作(只支持两个指令的管道):
        cmd1 | cmd2

myshell's People

Contributors

freesia810 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.