1、初識Shell

初識Shell

  1. shell是linux系統內核的一個外殼程序。
  2. 查看當前的shell工具linux

    echo $BASH

    輸出shell

    image

    表示當前是一個bash的環境。bash

  3. 編寫第一個shell腳本 firsh_shell.sh工具

    #!/bin/bash
    #FileName: first_shell.sh
    #Use: auto echo Hello World!
    #By authors: wl_it 2020.05.05
    
    echo "Hello World!"

    保存並修改執行權限 chmod u+x firsh_shell.shspa

    或者不改權限 使用 /bin/bash first_shell.sh 執行code

    說明:
    #!/bin/bash 固定寫法 表示腳本執行程序的路徑blog

    #FileName: first_shell.sh
    #Use: auto echo Hello World!
    #By authors wl_it 2020.05.05it

    上面三行是註釋class

    echo "Hello World!" 真正的命令權限

相關文章
相關標籤/搜索