Vim-Blogger Blogging

It's leet, but not quite tpope ready. So you'll have to wait.



Update #1: Sup sup

Update #2: More -n More -n More whitespace. :) Update #3: Now I have to read about Markdown symtax... sigh

#!/bin/sh

[ -f "/tmp/findhashed.bad" ] && rm /tmp/findhashed.bad
did=0 didnt=0

echo -n "Scanning"
for i in /bin/** /usr/bin/**; do
    [ ! -r "${i}" -o ! -x "${i}" -o -h "${i}" ] && continue

    if [ $(file "${i}" | awk '{print $2;}') = "ELF" ]; then
      readelf -d "${i}" 2>/dev/null|grep GNU_HASH 2>&1 > /dev/null
      if [ $? -eq 0 ]; then
        ((did++))
      else
        ((didnt++))
        echo $i >> /tmp/findhashed.bad
      fi
    fi

    # Progress indicator
    [ $((($did + $didnt)%14)) = 0 ] && echo -n .
done

total=$(($did + $didnt))
echo "Done"
echo "Of $total elf binaries:"
echo " $did contain a GNU_HASH section"
echo " $didnt do NOT contain a GNU_HASH section"
pctdid=$(($did*100/$total))
echo " $pctdid% are linked with new binutils! Now, on to Bdirect and prelink..."

echo "Ctrl-C to NOT view the list of offending executables."
read
less /tmp/findhashed.bad