创建脚本程序

作者在 2008-06-19 02:01:08 发布以下内容

脚本程序的创建可以说很简单,你可以通过文本编辑器来编辑.

脚本程序有一定的规则:

l脚本程序的注释:以#开头到本行结束
l脚本程序的一种特殊注释:以#开头,它告诉系统其后面的参数是用来执行本文件的程序。
l一个脚本程序:
       #!/bin/sh
  
      #first.sh
      #This file looks through all the files in the current directory
      #for the string “MYNAME”, and displays the content of those files.
      for file in *
      do
          if grep –q MYNAME $file
              then more $file
         fi
      done
      exit 0
LINUX应用 | 阅读 4110 次
文章评论,共0条
游客请输入验证码