Commit da0fa083 authored by frozar's avatar frozar

[DEV] Grab the subroutine declaration by taking care of the module suffix.

parent f89ab163
......@@ -22,8 +22,9 @@ outfile=l_s_${sub}
for f in ${files[*]}
do
echo " ====== $f"
beg=`grep -ni -e "^ *subroutine *${sub}" -e "^ *end *subroutine" $f | grep -i -e "^[0-9]*: *subroutine *$sub" -A1 | head -n1 | cut -d":" -f1`
end=`grep -ni -e "^ *subroutine *${sub}" -e "^ *end *subroutine" $f | grep -i -e "^[0-9]*: *subroutine *$sub" -A1 | tail -n1 | cut -d":" -f1`
id=$(echo ${f: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`
head -n $end $f | tail -n $((${end}-${beg}+1))
echo " ====== END $f"
echo ""
......
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