#!/bin/bash
RE_NAME='^ *string name *:' # regex for the 'name' line
RE_FUNSTART='^ *[{] *$' # regex for the start of the 'fun' block
RE_FUNEND='^ *[}] *$' # regex for end of 'fun' block
RE_FUN='^ *fun:' # regex for 'fun' line
while read line; do
if [[ $line =~ $RE_NAME ]]; then
name="${line##*: }"
echo
elif [[ $line =~ $RE_FUNSTART ]]; then
fun='1'
elif [[ $line =~ $RE_FUNEND ]]; then
fun=''
elif [[ ($line =~ $RE_FUN) && (-n $fun) ]]; then # match 'fun' lines only inside 'fun' block
echo "$name ${line##*: }"
fi
done < your_big_file
O Bash pode ser um pouco lento para arquivos grandes. Se for muito lento para você, você poderia portar o código para, por exemplo, Perl ou Python.