`

Linux学习Shell Script总结

阅读更多

1、Shell script是利用shell的功能所写的一个“程序”,这个程序是使用纯文本文件,将一些shell的语法与命令写在里面,搭配正则表达式、管道命令与数据流重定向等功能,以达到我们所想要的处理目的

2、shell script用在系统管理上面是很好的一项工具,但是用在处理大量数值运算上就不够好了,因为shell script的速度较慢,且使用的cpu资源较多,造成主机资源的分配不良。

3、在shell script的文件中,命令是从上而下、从左而又的分析与执行。

4、shell script 的执行至少需要有r的权限,若需要直接命令执行,则需要有r和x的权限。

5、在良好的程序编写习惯中,第一行要生命shell(#!/bin/bash),第二行以后则生命程序用途,版本,作者等

6、对谈式脚本可用read命令达成

7、要创建每次执行脚本都有不同结果的数据,可使用date命令利用日期达成

8、script的执行若以source来执行时,代表在父进程的bash内执行之意

9、若需要进行判断式,可使用test或中括号([])来处理

10、在script内,$0,$1,$2,,,,,,$@是有特殊意义的

11、条件判断式可使用if...then来判断,若是固定变量内容的情况下,可使用case $var in...esac来处理

12、循环主要分为不定循环(while   until )以及固定循环(for),配合do、done来达成所需任务!

13、可以使用sh -x script.sh来进行程序的调试

1
1
分享到:
评论

相关推荐

    Linux shell Script

    Linux shell Script, How to write shell script in Linux system.

    linux shell script tutorial_v2_r5.pdf

    linux shell script tutorial_v2_r5.pdf

    Linux Shell Scripting Cookbook 3rd.pdf

    linux shell 脚本攻略 学习 shell script 脚本 经典 linux shell scripting cookbook

    Shell Script教程

    身為 UNIX 系統管理者除了要熟悉 UNIX 指令外,我們最好學會幾種 scripts 語言,例如 shell script 或 perl。學會 script 語言後,我們就可以將日常的系統管理工作寫成一支執行檔,如此一來,在管理系統時就可以更加...

    Linux Shell Scripting Cookbook Second Edition

    详细讲解Linux脚本编写方法,包含大量例子演示编写shell脚本方法

    用Linux Command Shell模拟DOS命令

    几乎任何程序都可以通过shell script完成。你甚至可以在脚本内部完成简单的条件检查。简单的Shell scripting对于处理直截了当、没有变数的任务非常合适。而对于那些需要一定程度决策的工作来说,if/then条件假设就...

    Linux的shell脚本

    shell是一个用C语言编写的程序,它被称为用户使用linux的桥梁。 Shell既是一种命令语言,又是一种程序设计语言。 Shell 脚本(shell script),是一种为shell编写的脚本程序。

    利用LINUX SHELL Script实现数据库系统管理.pdf

    利用LINUX SHELL Script实现数据库系统管理.pdf

    linux shell script

    linux shell 学习资源,非常好,建议大家看看

    LINUX SHELL SCRIPT

    LINUX 脚本编程的文档,本文件全英文的特别好用,请大家来这里下载吧。

    101 shell script for linux and unix

    Chapter 9 - Web and Internet Administration Chapter 10 - Internet Server Administration Chapter 11 - Mac OS X Scripts Chapter 12 - Shell Script Fun and Games Afterword Index ...

    ShellScript

    我们要学习的不只是如何写出有用的Shell脚本,你还得了解如何迅速、确实地定制Shell,让程序的可移植性达到最佳状态,脱离对特定系统的依赖。这些技巧对任何操作与维护UNIX及Linux系统的人而言都很重要。本书所提供...

    Linux Shell Scripting Cookbook(3rd) 无水印pdf

    Linux Shell Scripting Cookbook(3rd) 英文无水印pdf 第3版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权...

    Mastering Linux Shell Scripting

    Shell scripting is a quick method to prototype a complex application or a problem by automating tasks when working on Linux-based systems. Using both simple one-line commands and command sequences ...

    Linux and Unix Shell Programming

    Most shell programming books merely annotate manual pages and syntax , but in this book users of all abilities will find plenty of practical working examples - all of which are available as full code ...

    Linux SHell Script

    Linux Shell Script with Bash , it is target for advanced user. it is useful

    Linux Shell Scripting Cookbook.epub

    Proper usage of shell commands can easily solve many complex tasks with a few lines of code, but most linux users don't have the right know-how to use the Linux shell to its full potential. ...

    [实验报告]Linux应用开发_Shell Script编程

    这是本人关于Shell Script编程的实验报告,里面是《鸟哥的 Linux 私房菜》里的练习例题和课后练习题。

    Linux Shell Scripting Cookbook.mobi

    Proper usage of shell commands can easily solve many complex tasks with a few lines of code, but most linux users don't have the right know-how to use the Linux shell to its full potential. ...

Global site tag (gtag.js) - Google Analytics