美文网首页
linux基本命令指南9-2:Shell脚本执行方式

linux基本命令指南9-2:Shell脚本执行方式

作者: 一言不合拔萝卜 | 来源:发表于2016-11-15 11:14 被阅读25次

注意点:
\xhh按照十六进制ASCII码表输出字符。其中hh是两位十六进制数
\0nnn按照八进制ASCII码表输出字符。其中0位数字零,nnn是三位八进制数

033是八进制
ESC = escape sequence

八进制 033 转义

m SGR Set attributes 设置属性

开始:\e[ attribute code;text color code m
结束 \e[0m

echo -e的作用: 支持反斜杠控制的字符转换

示例:echo -e "\e[1;32m linux \e[0m"

  • Shell执行

    #!/bin/Bash 标示脚本文件

    • 赋予执行权限,直接运行
      chmod 755 hello.sh
      ./hello.sh
    • 通过Bash调用执行脚本
      bash hello.sh

相关文章

网友评论

      本文标题:linux基本命令指南9-2:Shell脚本执行方式

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