如果你需要什么样的脚本,在这里提出来。我们一起完成它!
- percy
- 帖子: 508
- 注册时间: 2006-09-10 8:19
- 系统: Gentoo/Mac OS X
- 来自: Shanghai,China
- 联系:
-
- 帖子: 1
- 注册时间: 2007-08-10 5:31
求助
我在编译个程序,为了显示出系统的cupinfo信息。 但是运行不出来,下面的程序就是我试编的,请各位大虾请教。
# Main program
#
FILENAME="/proc/cpuinfo"
if [ -e $FILENAME ]
then
echo CPU info:
gawk '/vendor/ {print " "$0}
/model name/ {print " "$0}' $FILENAME
else
echo "the file was not found."
fi
# It works!!!
# Main program
#
FILENAME="/proc/cpuinfo"
if [ -e $FILENAME ]
then
echo CPU info:
gawk '/vendor/ {print " "$0}
/model name/ {print " "$0}' $FILENAME
else
echo "the file was not found."
fi
# It works!!!
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
-
- 帖子: 67
- 注册时间: 2007-08-17 14:04
-
- 帖子: 131
- 注册时间: 2006-10-25 17:50
- 来自: 南京
- 联系:
-
- 帖子: 14
- 注册时间: 2007-09-23 14:22
我需要一个能查找特级权限位,并且能根据用户的需要自动去除特级权限位的shell脚本,我完成了一点,但貌似有问题,各位大大帮帮我的忙阿。下面是 我写的:
#!/bin/sh
#this program is for change the file mod.
cd ./
find ./ -perm 4755 >tmp #save the filelist to tmp
set simulations='cat tmp' #read tmp and copy to varible simulations
echo "Find some files that is match to you,would you like to change the mod?"
echo "(press "y" for yes and press anykey for no)"
read flag
if(flag='y')then
{
foreach onesim($simulations) #each simulations' value will copy to varible onesim
chmod u-s $onesim #delete the suid from the file
echo "change "+$onesim+"'s mod"
}
else
exit
endif
#!/bin/sh
#this program is for change the file mod.
cd ./
find ./ -perm 4755 >tmp #save the filelist to tmp
set simulations='cat tmp' #read tmp and copy to varible simulations
echo "Find some files that is match to you,would you like to change the mod?"
echo "(press "y" for yes and press anykey for no)"
read flag
if(flag='y')then
{
foreach onesim($simulations) #each simulations' value will copy to varible onesim
chmod u-s $onesim #delete the suid from the file
echo "change "+$onesim+"'s mod"
}
else
exit
endif
- nofreedom618
- 帖子: 7
- 注册时间: 2007-09-06 21:12
求助啊!!!shell 判断文件和文件夹
首先以你的姓氏的拼音为开头在 /root 目录下建立3个文件和2个文件夹。如chen1 chen2 chen3 以及文件夹chen.d 和backup.d 。
然后写一个shell脚本程序,要求把/root下所有以chen开头的普通文件(注意不包括文件夹,因此需要作出相应判断)全部拷贝到back.d 下。
然后写一个shell脚本程序,要求把/root下所有以chen开头的普通文件(注意不包括文件夹,因此需要作出相应判断)全部拷贝到back.d 下。
-
- 帖子: 6
- 注册时间: 2007-11-21 13:40
- yaska
- 帖子: 1169
- 注册时间: 2007-10-28 21:35
-
- 帖子: 14
- 注册时间: 2007-06-26 16:16
- x007007007
- 帖子: 406
- 注册时间: 2007-11-07 17:53
- 系统: Mac
- 来自: shanghai
- 联系:
拨号上网的脚本
------------------------------------------------------------------------------------------
如果网接上了,运行脚本王就断开,
如果没网接上,运行脚本王就接上,
------------------------------------------------------------------------------------------
同时可以记录上网时间
------------------------------------------------------------------------------------------
谁有空帮忙做个,谢谢。绝对很有用!!
==========================================================================================
如果网接上了,运行脚本王就断开,
如果没网接上,运行脚本王就接上,
------------------------------------------------------------------------------------------
同时可以记录上网时间
------------------------------------------------------------------------------------------
谁有空帮忙做个,谢谢。绝对很有用!!
==========================================================================================