Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
files=(libtool ltmain.sh)
srcdir=`pwd`
IFS=$'\n'
for file in ${files[@]}
do
if [ ! -f ${srcdir}/${file} ]; then
continue
fi
num=
lines=($(grep -n -A 1 '[ \t]*\*.$objext)' ${srcdir}/${file}))
for line in ${lines[@]}
do
check_num=`echo -n ${line} | cut -d ':' -f 1`
check_process=`echo -n ${line} | cut -d '-' -f 2 | sed 's/[ \t]//g'`
num_empty=`echo -n ${check_num} | sed 's/[0-9]//g'`
if [ ! "x" = "x${check_num}" -a "x" = "x${num_empty}" ]; then
num=${check_num}
else
process=${check_process}
fi
if [ ! "x${num}" = "x" -a "${process}" = ";;" ]; then
sed -i -e "${num}s/\*\.\$objext/\*\.\$objext | \*\.gcno/" ${srcdir}/${file}
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.