shell script
wild_duck
这个作者很懒,什么都没留下…
展开
-
1.第一个 shell 脚本
第一个 shell script#!/bin/bash##This is a demo script that greets the world#Usage: ./helloclearecho hello worldexit 0clearecho hello worldexit 0"shebang";原创 2017-06-14 21:52:05 · 171 阅读 · 0 评论 -
3. 内部命令(Internal Command)和外部命令(External Command)
Linux命令分为内部命令和外部命令。 其中内部命令是指Linux内置的所有命令。 使用 help 就可以获得所有的内置命令。[root@localhost ~]# helpGNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)These shell commands are defined internally. Typ原创 2017-06-15 21:46:45 · 2962 阅读 · 0 评论 -
5. 变量(Variables)
shell 变量 variables原创 2017-06-17 10:21:56 · 403 阅读 · 0 评论 -
6. 使用read来定义变量
使用read 来定义变量原创 2017-06-17 14:20:24 · 463 阅读 · 0 评论 -
7. 引用其他脚本 (sourcing)
有时候我们想在自己的脚本中引用其他脚本主脚本[root@localhost ~]# vim master.sh #!/bin/bash #Example script to show how sourcing works. /root/sourcemeecho the value of variable '$COLOR' is $COLORexit 0被引用的脚本 /root/sourceme原创 2017-06-20 13:13:33 · 316 阅读 · 0 评论 -
8. 转义字符 (单引号,双引号和 "\ ")
linux 转义字符原创 2017-06-21 22:57:53 · 2508 阅读 · 0 评论 -
2.运行 shell 脚本
2. 运行 shell 脚本原创 2017-06-15 10:00:40 · 159 阅读 · 0 评论