一、输出命令echo

  语法:echo 【选项】【输出内容】
    选项
    -e:支持反斜线控制的字符转换
【Linux】shell基础——shell脚本的执行方式
【Linux】shell基础——shell脚本的执行方式

【Linux】shell基础——shell脚本的执行方式

二、脚本编写与执行

2.1 编写脚本

  语法:vi 脚本名.sh后缀.sh告诉系统创建的为bash脚本。
    内容:
    #!/bin/bash  标志写的是shell脚本
    shell的脚本内容
【Linux】shell基础——shell脚本的执行方式

【Linux】shell基础——shell脚本的执行方式

2.2 执行脚本

  语法:
    方法1:赋予脚本执行权限,直接通过脚本路径运行
【Linux】shell基础——shell脚本的执行方式

    方法2:通过Bash调用执行脚本:bash 脚本名
【Linux】shell基础——shell脚本的执行方式

相关文章:

  • 2021-05-08
  • 2021-11-08
  • 2021-11-12
  • 2021-11-08
  • 2021-10-17
  • 2021-11-23
  • 2021-11-30
  • 2021-11-20
猜你喜欢
  • 2021-10-17
  • 2021-12-04
  • 2021-11-23
  • 2021-12-16
  • 2021-04-22
  • 2021-06-03
相关资源
相似解决方案