Chinaunix首页 | 论坛 | 博客
  • 博客访问: 271045
  • 博文数量: 101
  • 博客积分: 4245
  • 博客等级: 上校
  • 技术积分: 1085
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-24 00:28
文章分类

全部博文(101)

文章存档

2012年(1)

2011年(16)

2010年(34)

2009年(50)

我的朋友

分类: LINUX

2010-02-20 00:15:39

第一部分:介绍


A shell script is a quick-and-dirty method of prototyping a complex application. Getting even a limited subset of the functionality to work in a script is often a useful first stage in project development. This way, the structure of the application can be tested and played with, and the major pitfalls found before proceeding to the final coding in C, C++, Java, , or Python.

When not to use shell scripts

  • Resource-intensive tasks, especially where speed is a factor (sorting, hashing, recursion ...)

  • Procedures involving heavy-duty math operations, especially floating point arithmetic, arbitrary precision calculations, or complex numbers (use C++ or FORTRAN instead)

  • Cross-platform portability required (use C or Java instead)

  • Complex applications, where structured programming is a necessity (type-checking of variables, function prototypes, etc.)

  • Mission-critical applications upon which you are betting the future of the company

  • Situations where security is important, where you need to guarantee the integrity of your system and protect against intrusion, cracking, and vandalism

  • Project consists of subcomponents with interlocking dependencies

  • Extensive file operations required (Bash is limited to serial file access, and that only in a particularly clumsy and inefficient line-by-line fashion.)

  • Need native support for multi-dimensional arrays

  • Need data structures, such as linked lists or trees

  • Need to generate / manipulate graphics or GUIs

  • Need direct access to system hardware

  • Need port or socket I/O

  • Need to use libraries or interface with legacy code

  • Proprietary, closed-source applications (Shell scripts put the source code right out in the open for all the world to see.)



第三章 特殊字符
#  1:注释,shell脚本第一行的#!除外,针对某一行的注释时,#必须和语句之间有一个空格
   2:在做形如${param#word}和${param##word}的参数扩展

阅读(1225) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~