Shell scripting 1 - introduction
来源:互联网 发布:linux多进程服务器 编辑:程序博客网 时间:2024/05/18 14:44
Purpose Of This Tutorial
This tutorial is written to help people understand some of the basics of shellscript programming, and hopefully to introduce some of the possibilities of simple butpowerful programming available under the bourne shell. As such, it has been written asa basis for one-on-one or group tutorials and exercises, and as a reference for subsequentuse.
A Brief History of sh
Steve Bourne, wrote the Bourne shell which appeared in the Seventh Edition Bell Labs Research version of Unix.Many other shells have been written; this particular tutorial concentrateson the Bourne and the Bourne Again shells.
Other shells include the Korn Shell (ksh), the C Shell (csh), and variations such as tcsh.
This tutorial does not cover those shells. Maybe a future version will cover ksh; I donot intend to write a tutorial for csh, ascsh programming is considered harmful.
Typographical Conventions Used in This Tutorial
Significant words will be written in italics when mentioned for thefirst time.
Code segments and script output will be displayed as preformatted text.
Command-line entries will be preceded by the Dollar sign ($). If your prompt is different,enter the command:
PS1="$ " ; export PS1
Then your interactions shouldmatch the examples given (such as $ ./my-script.sh below).
Script output (such as "Hello World" below) is displayed at the start of the line.
$ echo '#!/bin/sh' > my-script.sh$ echo 'echo Hello World' >> my-script.sh$ chmod 755 my-script.sh$ ./my-script.shHello World$Entire scripts will be surrounded by thick horizontal rules and include a referencewhere available to the plain text of the script:
first.sh
#!/bin/sh# This is a comment!echo Hello World # This is a comment, too!
Note that to make a file executable, you must set the eXecutable bit, and for a shellscript, the Readable bit must also be set:
$ chmod a+rx first.sh
- Shell scripting 1 - introduction
- Scripting Introduction
- Introduction to Scripting
- Linux Shell Scripting Cookbook 学习记录1
- Learning Shell Scripting
- Mastering UNIX Shell Scripting
- Beginning Shell Scripting
- Linux Shell Scripting Tutorial
- Classic Shell Scripting
- Linux Shell Scripting Tutorial
- SHELL SCRIPTING 教學與心得
- Classic Shell Scripting
- Shell Scripting Cookbook1
- Linux Shell Scripting Cookbook
- Basic shell scripting questions
- 09 Bash Shell Scripting
- 转载:UNIX Bourne Shell Scripting
- 10 good shell scripting practices
- base-kernel-file-layout
- sqlserver2008附加数据库是“只读”的解决办法
- Linux进程的实际用户ID和有效用户ID
- windows 2003 server IIS权限设置
- 分享一个异步发送邮件的类
- Shell scripting 1 - introduction
- 获得文件头编辑框中多行文本
- 在iOS应用中使用GPS
- 黑马程序员-委托
- VC:利用 CPtrArray 类保存图像
- 模拟设计工具大比拼
- js随笔一
- mongodb 更新操作
- CSS定位技术