Commit 359490d2 authored by Fabien Rozar's avatar Fabien Rozar

get_one_subroutine.sh: be able to deal with function.

parent 853ee807
......@@ -19,6 +19,7 @@ sub=$2
f_id=$(basename $f)
id=$(echo ${f_id:4:5})
beg=`grep -ni -e "^ *subroutine *${sub}_${id}" -e "^ *end *subroutine" $f | grep -i -e "^[0-9]*: *subroutine *$sub" -A1 | head -n2 | head -n1 | cut -d":" -f1`
end=`grep -ni -e "^ *subroutine *${sub}_${id}" -e "^ *end *subroutine" $f | grep -i -e "^[0-9]*: *subroutine *$sub" -A1 | head -n2 | tail -n1 | cut -d":" -f1`
beg=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}_${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *$sub" -A1 | head -n2 | head -n1 | cut -d":" -f1`
end=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}_${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *$sub" -A1 | head -n2 | tail -n1 | cut -d":" -f1`
head -n $end $f | tail -n $((${end}-${beg}+1))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment