You may need a script to print the desired lines. If you are using csh (unlikely!), Use:
make ... |& show_gcc_line
with the show_gcc_linefollowing script:
#!/bin/csh
set input="$<"
while ( "$input" )
echo "$input"
set loc=`echo "$input" | sed -n 's/^\([^ :]*\):\([0-9]*\):.*/\1 \2/p'`
if ( $#loc ) then
find . -name $loc[1] | xargs sed -n $loc[2]s/^/---------------/p
endif
set input="$<"
end
And for bash use make ... 2>&1 | show_gcc_linewith:
#!/bin/bash
while read input
do
echo "$input"
loc=$(echo "$input" | sed -n 's/^\([^ :]*\):\([0-9]*\):.*/\1 \2/p')
if [ ${#loc} -gt 0 ]
then
find . -name ${loc% *} | xargs sed -n ${loc#* }s/^/---------------/p
fi
done
source
share