Created
May 22, 2013 22:49
-
-
Save kjdev/5631566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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