tools: acrntrace: Remove unused pre_process.sh

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Kaige Fu 2018-06-29 09:24:27 +08:00 committed by lijinxia
parent ad89a22011
commit 5907400182
1 changed files with 0 additions and 33 deletions

View File

@ -1,33 +0,0 @@
#!/bin/bash
IFILE=$1
STR=$2
BAK_FILE=${IFILE}.orig
if [ ! -f $BAK_FILE ]; then
cp $IFILE $BAK_FILE
fi
echo $IFILE, $BAK_FILE, $STR
FIRST_LINE=$(grep -n $STR -m 1 $IFILE | awk -F: '{print $1}')
LAST_LINE=$(grep -n $STR $IFILE | tail -1 | awk -F: '{print $1}')
TOTAL_LINE=$(wc -l $IFILE | awk '{print $1}')
echo $FIRST_LINE, $LAST_LINE, $TOTAL_LINE
if [[ $FIRST_LINE -ge $LAST_LINE || $LAST_LINE -gt $TOTAL_LINE ]]; then
exit 1
fi
if [[ $LAST_LINE -lt $TOTAL_LINE ]]; then
let LAST_LINE=$((LAST_LINE))+1
echo "sed -i ${LAST_LINE},${TOTAL_LINE}d $IFILE"
sed -i ${LAST_LINE}','${TOTAL_LINE}'d' $IFILE
fi
if [[ $FIRST_LINE -gt 2 ]]; then
let FIRST_LINE=$((FIRST_LINE))-1
echo "sed -i 2,${FIRST_LINE}d $IFILE"
sed -i '2,'${FIRST_LINE}'d' $IFILE
fi