小弟对linux的SHELL不是很熟悉,目前正在捧着一本"shell 范例精解"在看。 但现在我有一个需求,不知有没有人帮我实现。 我主要是想通过SHELL实现磁盘监控,比方说我想针对 /data 这个分区进行监控,当使用空间超过80%的时候,就发送警告邮件。 不知这个能不能实现。 是不是从 #df -sh 中取得某一字段然后进行判断,具体怎么做,小弟实在不太清楚。
修正待机脚本: [code]#!/bin/bash # default display on current host DISPLAY=:0.0 # find out if DPMS is enabled STATUS=`/usr/X11R6/bin/xset -display $DISPLAY -q | grep -e 'DPMS is'` # enable DPMS if disabled if [ "$STATUS" == " DPMS is Disabled" ] then echo "Enabling DPMS ..." >>/etc/acpi/actions/stay.txt /usr/X11R6/bin/xset -di...
#!/bin/bash
_FROM=`cat /home/lg/var/frommaillist` #存放发送者的邮件列表,主要目的是为掩人而目.
_maillist=`cat /home/lg/var/tomaillist`#存放接收邮件者的列表.
Sub="From Google maillist!"
for F in $_FROM
do
for x in $_maillist
do
for ((i=1; i<2000; i++)) #循环的次数,该值乘于frommaillist再乘于tomaillist的个数,就是本次发送邮件的全部个数.
{
sendmail -t <
环境: redhat9 [code] #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin ############################################################# # This is a script that tests if network is well! # # created by irror # # CopyRight by CU # ##########################################...
我写了这样一个脚本,内容如下: #!/bin/sh echo "good" 文件存储到/tmp/startup.sh 然后操作如下命令: >cd /tmp >chmod +rwx ./startup.sh >./startup.sh 最后一条命令得到下面的响应 : bad interpreter: No such file or directory 各位高手能否帮我解释一下,最后一条命令为什么会出现那样的响应结果,我错 在了哪里? 谢谢!
[oracle@ciqdz /temp]$ ls -l total 4 -rwxrwxr-x 1 oracle dba 669 Oct 27 10:34 autodetect.sh* [oracle@ciqdz /temp]$ ./autodetect.sh bash: ./autodetect.sh: No such file or directory [oracle@ciqdz /temp]$ more autodetect.sh #!/bin/sh echo "----------------------------start------------------------";date #set environment variable ORACLE_BASE=/u01/product; export ORACLE_BASE ORACLE_HOME...