Denys Vlasenko | 0f89605 | 2010-07-26 01:35:44 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | grep -n -B1 -r $'^\t*}$' . | grep -A1 '.[ch]-[0-9]*-$' |
| 4 | grep -n -A1 -r $'^\t*{$' . | grep -B1 '.[ch]-[0-9]*-$' |
| 5 | # or (less surefire ones): |
| 6 | grep -n -B1 -r $'^\t*}' . | grep -A1 '.[ch]-[0-9]*-$' |
| 7 | grep -n -A1 -r $'^\t*{' . | grep -B1 '.[ch]-[0-9]*-$' |
Denys Vlasenko | ba2dccc | 2010-07-26 01:49:12 +0200 | [diff] [blame] | 8 | |
| 9 | # find trailing empty lines |
Bernhard Reutner-Fischer | 3d615b8 | 2010-07-28 21:29:19 +0200 | [diff] [blame] | 10 | find -type f | while read file; do |
Denys Vlasenko | ba2dccc | 2010-07-26 01:49:12 +0200 | [diff] [blame] | 11 | test x"$file" = x"" && continue |
Bernhard Reutner-Fischer | 3d615b8 | 2010-07-28 21:29:19 +0200 | [diff] [blame] | 12 | tail -n1 $file | while read lastline |
| 13 | do |
| 14 | #echo "|$file|$lastline" |
| 15 | if test x"$lastline" = x""; then |
Denys Vlasenko | ba2dccc | 2010-07-26 01:49:12 +0200 | [diff] [blame] | 16 | echo "$file" |
Bernhard Reutner-Fischer | 3d615b8 | 2010-07-28 21:29:19 +0200 | [diff] [blame] | 17 | fi |
| 18 | done |
Denys Vlasenko | ba2dccc | 2010-07-26 01:49:12 +0200 | [diff] [blame] | 19 | done |