- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
linux sh脚本编程(Linux sh脚本编程)
linux sh脚本编程(Linux sh脚本编程)
Linux, SH scripting
In Linux systems, although there are a variety of graphical interface tools, sell is still a very flexible tool. Shell is not just a collection of commands, but a very good programming language. You can automate a large number of tasks by using shell, and shell is especially good at system management tasks, especially for tasks that are easier to use, maintainable, and portable than efficiency.
Next, lets see how shell works:
Create a script
There are a lot of different shell in Linux, but usually we use bash (Bourne again shell) to program shell because Bash is free and easy to use. So in this article, the scripts I provide are all using bash (but in most cases, these scripts can also run in Bashs sister Bourne shell).
Like any other language, we write our shell program by using any kind of text editor such as nedit, kedit, Emacs, VI, and so on. The program must start with the following line (must be on the first line of the file):
# /bin/sh!
The symbol #! To tell the parameters of the system after it is used to execute the program file. In this example, we use /bin/sh to execute the program.
When you edit a script, you must also make it executable if you want to execute the script.
To make the script executable:
Chmod +x filename
You can then execute your script by typing:./filename.
Notes
In shell programming, to # at the beginning of the sentence annotation, until the end of the line. We sincerely recommend that you use notes in your program. If you use the annotation, you can understand the function and working principle of the script in a very short time even if you do not use the script for quite a long time.
variable
In other programming languages, you must use variables. In shell programming, all variables are made up of strings, and you dont need to declare variables. To assign to a variable, you can write it like this:
Variable name = value
Take out the variable value and add a dollar sign ($) in front of the
您可能关注的文档
- 5600脚本(5600 script).doc
- 5摄像教程之--参与和解脱功能(5 Video Tutorials - participation and relief).doc
- 500强的强者思维(500 strong thinking).doc
- 5月-3e薪资设计与薪酬管理技巧(-3e salary design and salary management skills in May).doc
- 61-惠州市小金河(一河两渠)整治工程(二期)(61- Huizhou small Jinhe River (one river, two canals) Regulation Project (two issue)).doc
- 62-天长市平安南路(天康大道(Tianchang Ping An Nan Lu 62- (Kang Road).doc
- 68-三人行网络班级创建操作手册(68- three people online class creation manual).doc
- 6个小故事揭示美国人的赚钱之道(6 little stories tell Americans how to make money).doc
- 6室内绿化植物选择(6 selection of indoor plants).doc
- 680例子宫输卵管造影术的护理体会(Nursing experience of 680 cases of uterine tubal radiography).doc
- linux项目实战(Linux project actual combat).doc
- linux系统如何修改端口号(How does the Linux system modify port numbers).doc
- lis(LIS).doc
- live800系统faq(Live800 system FAQ).doc
- loadrunner脚本录制常见问题整理(LoadRunner script recording FAQ).doc
- loopback接口简介(Introduction of loopback interface).doc
- linux文件转换以及展示(Linux file conversion and display).doc
- lotus note id 剖析(lotus notes 剖析 id).doc
- lsat题型与gmat逻辑的异同(Similarities and differences between LSAT questions and GMAT logic).doc
- lucene分页(Lucene paging).doc
文档评论(0)