2道脚本的题不会..........能帮忙嘛..........

2道脚本的题不会..........能帮忙嘛..........

题目如下:
1.编一个shell脚本程序,该程序将扫描等录用户的默认目录,对所有以“.a”为后缀的文件合并到用户默认目录下的“total.a”文件中,并删除原来的文件$HOME    rm.-t  *a

2.编写shell程序。对指定的一个或多个目录,检查其中文件的属性是否为777,如发现这样的文件则提示该文件有危险的属性,并将其属性改为754  

由于刚接触linux,要是这个问题太简单的话............当没看见好了................
谢谢先~      
1.Time limited , so .....

#!/bin/sh
w|grep -v "average" |grep -v "USER" | awk '{print $1}' |uniq >user.list
USERLIST=`cat user.list`
echo -e "Starting move files...\n\n"
rm -f total.a 2>/dev/null
mkdir total.a 2>/dev/null

for USER in $USERLIST
do
find ./ -name \*.a -print | mv *.a total.a 2>/dev/null
echo -e "\nThe userUSER SUCCEEDED ..."
done


#I have successfully test in Redhat 9 environment . U can use it .: )      
2. Time limited ,so pls U test it .


#!/bin/sh
function usage
{
echo -e "\n\nUsage: $0 [yourfile] ...\n\n"
}
if [ $# == 0 ]
then
usage
exit 1
fi

find $1 -perm 777 -print >file.list
FILELIST=`cat file.list`
echo -e "Starting modify risk files...\n\n"
for FILE in $FILELIST
do
chmod -f 744 $FILE
echo -e "\nThe fileFILE have been modified ..."
done


#if you have any suggestion ,pls let me know via email;
#my email : yearnx@yeah.net      
我考虑了一下,不知道对不对。
#!/bin/sh
cd $HOME
cat *.a > $HOME/total.a
rm -fr $HOME/*.a

#!/bin/sh
for a in
do
find $a -type f -perm 777 -exec chmod 754 {} \;
done