美文网首页
Mac 为 shell 添加函数

Mac 为 shell 添加函数

作者: _凌浩雨 | 来源:发表于2019-10-29 10:21 被阅读0次

    1. 查看 shell

    cat /etc/shells
    

    2. 修改默认 shell

    chsh -s /bin/sh
    

    3. 添加 shell 命令

    • 创建hello文件
    #!/bin/bash
    echo "hello world 2019.10.29"
    
    • 赋予可运行权限
    chmod +x hello
    
    • 运行
    ./hello
    

    相关文章

      网友评论

          本文标题:Mac 为 shell 添加函数

          本文链接:https://www.haomeiwen.com/subject/wgrwvctx.html