2010-07-25 23:35:44 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
grep -n -B1 -r $'^\t*}$' . | grep -A1 '.[ch]-[0-9]*-$'
|
|
|
|
grep -n -A1 -r $'^\t*{$' . | grep -B1 '.[ch]-[0-9]*-$'
|
|
|
|
# or (less surefire ones):
|
|
|
|
grep -n -B1 -r $'^\t*}' . | grep -A1 '.[ch]-[0-9]*-$'
|
|
|
|
grep -n -A1 -r $'^\t*{' . | grep -B1 '.[ch]-[0-9]*-$'
|
2010-07-25 23:49:12 +00:00
|
|
|
|
|
|
|
# find trailing empty lines
|
2010-07-28 19:29:19 +00:00
|
|
|
find -type f | while read file; do
|
2010-07-25 23:49:12 +00:00
|
|
|
test x"$file" = x"" && continue
|
2010-07-28 19:29:19 +00:00
|
|
|
tail -n1 $file | while read lastline
|
|
|
|
do
|
|
|
|
#echo "|$file|$lastline"
|
|
|
|
if test x"$lastline" = x""; then
|
2010-07-25 23:49:12 +00:00
|
|
|
echo "$file"
|
2010-07-28 19:29:19 +00:00
|
|
|
fi
|
|
|
|
done
|
2010-07-25 23:49:12 +00:00
|
|
|
done
|