sh.sh

--a.sh--
#!/bin/sh
for unzipfile in $(ls *.tgz)
do
tar -zxf $unzipfile
echo "$unzipfile done!"
rm $unzipfile
done

--sh.sh--
rm -r /home/bbs/usr
rm -r /home/bbs/brd
rm -r /home/bbs/gem/brd
rm /home/bbs/.BRD
rm /home/bbs/.USR
mkdir /home/bbs/usr
mkdir /home/bbs/brd
mkdir /home/bbs/gem/brd
cp -r /bbs.data/usr0831.0901.02.03/* /home/bbs/usr/
cp /home/bbs/a.sh /home/bbs/usr/a
cd /home/bbs/usr/a
sh a.sh
mv a.sh ../b
cd ../b
sh a.sh
mv a.sh ../c
cd ../c
sh a.sh
mv a.sh ../d
cd ../d
sh a.sh
mv a.sh ../e
cd ../e
sh a.sh
mv a.sh ../f
cd ../f
sh a.sh
mv a.sh ../g
cd ../g
sh a.sh
mv a.sh ../h
cd ../h
sh a.sh
mv a.sh ../i
cd ../i
sh a.sh
mv a.sh ../j
cd ../j
sh a.sh
mv a.sh ../k
cd ../k
sh a.sh
mv a.sh ../l
cd ../l
sh a.sh
mv a.sh ../m
cd ../m
sh a.sh
mv a.sh ../n
cd ../n
sh a.sh
mv a.sh ../o
cd ../o
sh a.sh
mv a.sh ../p
cd ../p
sh a.sh
mv a.sh ../q
cd ../q
sh a.sh
mv a.sh ../r
cd ../r
sh a.sh
mv a.sh ../s
cd ../s
sh a.sh
mv a.sh ../t
cd ../t
sh a.sh
mv a.sh ../u
cd ../u
sh a.sh
mv a.sh ../v
cd ../v
sh a.sh
mv a.sh ../w
cd ../w
sh a.sh
mv a.sh ../x
cd ../x
sh a.sh
mv a.sh ../y
cd ../y
sh a.sh
mv a.sh ../z
cd ../z
sh a.sh
rm a.sh
mkdir /home/bbs/usr/@
chown -R bbs:bbs /home/bbs/usr
cp -r /bbs.data/brd0904.05/* /home/bbs/brd
cp /home/bbs/a.sh /home/bbs/brd
cd /home/bbs/brd
sh a.sh
rm a.sh
chown -R bbs:bbs /home/bbs/brd
cp -r /bbs.data/gem0906/* /home/bbs/gem/brd
cp /home/bbs/a.sh /home/bbs/gem/brd
cd /home/bbs/gem/brd
sh a.sh
rm a.sh
chown -R bbs:bbs /home/bbs/gem
cp /bbs.data/20080907.BRD /tmp
cp /bbs.data/20080907.USR /home/bbs/.USR

沒有留言: