Linux笔记(11)——Shell脚本执行
来源:互联网 发布:家长控制软件 编辑:程序博客网 时间:2024/05/17 02:56
echo命令
echo命令:在屏幕上输入一串字符串,支持控制字符(要加-e选项),和颜色控制
如:
echo “hello world”
echo -e “hello world \n”
echo -e “\e[1;31m 呵呵哒 \e[0m “(31m表示颜色,\e[1; 表示颜色开始, \e[0m表示颜色结束)
第一个脚本
vim hello.sh
脚本内容:
#!/bin/bash#上一行是脚本中必须有的echo "hello world"
#号表示注释,但是#!/bin/bash不表示注释,是shell脚本中必须有的,说明这是一个脚本文件。如果不写,当脚本中调用了其他语言时,将会报错。
执行脚本:
方法一:bash hello.sh
方法二(推荐使用):
1. 先修改脚本的权限为可执行:chmod 755 hello.sh
2. 执行:./hello.sh 或者使用绝对路径:/xxx/xxx/hello.sh
0 0
- Linux笔记(11)——Shell脚本执行
- Linux笔记11-Shell脚本执行方式
- linux学习笔记—shell脚本执行方式
- linux执行shell脚本
- Linux执行shell脚本
- Linux shell脚本攻略——笔记(1)
- Linux战地日记—shell脚本的建立与执行
- Linux Shell 脚本编程(1)—Shell脚本基础知识
- linux 定时执行shell脚本
- linux 定时执行shell脚本
- linux 定时执行shell脚本
- linux 定时执行shell脚本
- linux 定时执行shell脚本
- linux 定时执行shell脚本
- linux执行shell脚本的
- Linux下执行Shell脚本
- linux定时执行shell脚本
- LINUX定时执行shell脚本
- iOS证书过期解决方案
- 【CSS3】文本阴影text-shadow
- 使用PopupWindow自定义的下拉框
- 扩展kmp算法讲解
- 1088. Rational Arithmetic (20)
- Linux笔记(11)——Shell脚本执行
- java获取各种格式的时间,获取昨天明天日期,获取一天的开始结束时间
- Maven 那点事儿
- matlab 判断两个矩阵是否相等
- 内部类的概述和讲解
- Mycat连续分片(自定义数字范围分片)学习
- POJ 3468A Simple Problem with Integers(线段树)
- goke开发杂记
- -Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable