4 if [ "$1" = "-C" ] ; then
11 if [[ "$file" = "" ]] ; then
12 echo "Usage: $0 [-C <lines of context>] <file with smatch messages>"
16 grep 'if();' $file | cut
-d ' ' -f1 |
while read loc
; do
17 code_file
=$
(echo $loc | cut
-d ':' -f 1)
18 line
=$
(echo $loc | cut
-d ':' -f 2)
19 echo "========================================================="
21 tail -n +$
(($line - ($context - 1))) $code_file |
head -n $
(($context - 1))
22 if [[ $context -gt 1 ]] ; then
23 echo "---------------------------------------------------------"
25 tail -n +${line} $code_file |
head -n $context