当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: V1.01Last Editionby Thomas(2005-
 

 

 ·关于脚本的第一行    »显示摘要«
    摘要:一直以为脚本的第一行是必须要以类似“#!/bin/sh”这样一个说明来开始的,昨天,发现错了。脚本可以没有这个解释器的说明,如果没有这个解释器的话,那么执行脚本的时候就会使用当前的shell来解释,如果是在系统启动的时候运行这个脚本估计就有问题了,因为这个时候似乎还没有任何shell被载入。(可惜没什么时间去验证)......
    摘要:代码:for ((i=1;i<=10;i++)) do echo "num is $i" donenum=1 代码:num=1 while [ "$num" -le 10 ]; do echo "num is $num" num=$(($num + 1)) done十三问,我是从去年新年开始看的中途看看停停,今天晚上总算看完了,看完......


MRTG交换机各端口当前流量排序scripts
v1.01  last edition by thomas(2005-2-4)

【程序编程相关:Oblique Frustum Clip

【推荐阅读:比较不错的手机FC模拟器!

前言: 【扩展信息:Programming in Lua翻译

  脚本在freebsd4.10上测试完成.于原文上的相关脚本(用于linux)做了相应修改.

参考:

  http://www.net130.com/2004/6-22/224959.html

          ――使用mrtg监控网络信息流量

 

 

 

 

 

目 录

排序脚本(加到/etc/crontab中) - 2 -

附件:通过建立bash脚本自动化配置mrtg.cfg文件的步骤 - 5 -

1.建立/etc/mrtg/mrtgip(权限为600) - 5 -

2.建立文件/etc/mrgt/mrtglocate(权限为600) - 5 -

3.建立bash脚本文件 - 6 -

4.建立/usr/local/www/data/mrtg/index.html文件 - 7 -

5.为web服务器建立密码 - 8 -

 

排序脚本(加到/etc/crontab中)

#!/bin/sh

#  mrtgsort v1.01

#last edition by thomas 2005-2-4

#in /etc/crontab, just add to the end of mrtg sentence in /etc/crontab, example:

#*/5     *       *       *       *       root    /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg;/usr/local/etc/mrtg/mrtgsort.sh

#

#start....

#

>/tmp/tmp1

>/tmp/tmp2

>/tmp/tmp3

mrtgdir=/usr/local/www/data/mrtg

ls $mrtgdir/1/192*html>/tmp/tmp1

ls $mrtgdir/2/192*html>>/tmp/tmp1

for i in `cat /tmp/tmp1`

do

   more $i|grep title>>/tmp/tmp2

   more $i|grep %


...   下一页
 ·9) $@ 與 $* 差在哪?    »显示摘要«
    摘要:#!/bin/bash my_fun() { echo inside function is echo inside function is echo inside function is } echo outside function is echo outside function is echo outside function is my_fun fp1 "fp2 fp3&quo......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE