Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/bent/scripts: replace deprecated egrep with grep -E #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/bent/scripts/benchdwarf
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ if [ ${bench} = "yes" ] ; then
echo "goos: $GOOS"
echo "goarch: $GOARCH"
echo "pkg:" # Erase any inherited pkg if files are concatenated
if echo $inputsquality | egrep -q '[.0-9]+' ; then
if echo $inputsquality | grep -E -q '[.0-9]+' ; then
echo Unit inputs-quality assume=exact
echo "Benchmark${2}_dwarf_input_goodness" 1 ${inputsquality} inputs-quality
fi
if echo $argsquality | egrep -q '[.0-9]+' ; then
if echo $argsquality | grep -E -q '[.0-9]+' ; then
echo Unit args-quality assume=exact
echo "Benchmark${2}_dwarf_args_goodness" 1 ${argsquality} args-quality
fi
if echo $stmtquality | egrep -q '[.0-9]+' ; then
if echo $stmtquality | grep -E -q '[.0-9]+' ; then
echo Unit stmts-quality assume=exact
echo "Benchmark${2}_dwarf_stmt_goodness" 1 ${stmtquality} stmts-quality
# echo "Benchmark${2}_dwarf_stmt_goodness_kind" 1 ${stmtkindquality} stmts-quality
Expand Down
18 changes: 9 additions & 9 deletions cmd/bent/scripts/benchsize
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ fi


# note total is different -- always $2
total=`egrep -i '^total' $tmp | awk -Wposix '{print $2}'`
total=`grep -E -i '^total' $tmp | awk -Wposix '{print $2}'`

text=`egrep [^a-z]text[^a-z] $tmp | awk -Wposix "$awkcommand"`
text=`grep -E [^a-z]text[^a-z] $tmp | awk -Wposix "$awkcommand"`
gopclntab=`grep gopclntab $tmp | awk -Wposix "$awkcommand"`
rodata=`grep rodata $tmp | awk -Wposix "$awkcommand"`
data=`egrep [^a-z]data[^a-z._] $tmp | awk -Wposix "$awkcommand"`
data=`grep -E [^a-z]data[^a-z._] $tmp | awk -Wposix "$awkcommand"`

zdebug_info=`grep zdebug_info $tmp | awk -Wposix "$awkcommand"`
zdebug_loc=`grep zdebug_loc $tmp | awk -Wposix "$awkcommand"`
Expand All @@ -46,34 +46,34 @@ echo "goos: $GOOS"
echo "goarch: $GOARCH"
echo "pkg:" # Erase any inherited pkg if files are concatenated

if echo $total | egrep -q '[0-9]+' ; then
if echo $total | grep -E -q '[0-9]+' ; then
echo Unit total-bytes assume=exact
echo "Benchmark${2}_total" 1 ${total} total-bytes
fi

if echo $text | egrep -q '[0-9]+' ; then
if echo $text | grep -E -q '[0-9]+' ; then
echo Unit text-bytes assume=exact
echo "Benchmark${2}_text" 1 ${text} text-bytes
fi

if echo $data | egrep -q '[0-9]+' ; then
if echo $data | grep -E -q '[0-9]+' ; then
echo Unit data-bytes assume=exact
echo "Benchmark${2}_data" 1 ${data} data-bytes
fi

if echo $rodata | egrep -q '[0-9]+' ; then
if echo $rodata | grep -E -q '[0-9]+' ; then
echo Unit rodata-bytes assume=exact
echo "Benchmark${2}_rodata" 1 ${rodata} rodata-bytes
fi

if echo $gopclntab | egrep -q '[0-9]+' ; then
if echo $gopclntab | grep -E -q '[0-9]+' ; then
echo Unit pclntab-bytes assume=exact
echo "Benchmark${2}_pclntab" 1 ${gopclntab} pclntab-bytes
fi

zdebug=`expr ${zdebug_info} + ${zdebug_loc} + ${zdebug_line} + ${zdebug_ranges} + ${zdebug_frame} + ${zdebug_abbrev} + ${zdebug_pubname} + ${zdebug_pubtype}`

if echo $zdebug | egrep -q '[0-9]+' ; then
if echo $zdebug | grep -E -q '[0-9]+' ; then
echo Unit zdebug-bytes assume=exact
echo "Benchmark${2}_zdebug_total" 1 ${zdebug} zdebug-bytes
fi
Expand Down
4 changes: 2 additions & 2 deletions cmd/bent/scripts/cmpcl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ newlog="new-${newtag}"

cat ${RUN}.Old.build > ${oldlog}
cat ${RUN}.New.build > ${newlog}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Old.stdout >> ${oldlog}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.New.stdout >> ${newlog}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Old.stdout >> ${oldlog}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.New.stdout >> ${newlog}
cat ${RUN}.Old.{benchsize,benchdwarf} >> ${oldlog}
cat ${RUN}.New.{benchsize,benchdwarf} >> ${newlog}
benchsave -header "${STAMP}" "${oldlog}" "${newlog}"
Expand Down
4 changes: 2 additions & 2 deletions cmd/bent/scripts/cmpjob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ newlog="new-${newtag}"

cat "${RUN}.Old.build" > "${oldlog}"
cat "${RUN}.New.build" > "${newlog}"
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' "${RUN}.Old.stdout" >> "${oldlog}"
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' "${RUN}.New.stdout" >> "${newlog}"
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' "${RUN}.Old.stdout" >> "${oldlog}"
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' "${RUN}.New.stdout" >> "${newlog}"
cat "${RUN}.Old.{benchsize,benchdwarf}" >> "${oldlog}"
cat "${RUN}.New.{benchsize,benchdwarf}" >> "${newlog}"
benchsave -header "${STAMP}" "${oldlog}" "${newlog}"
Expand Down
12 changes: 6 additions & 6 deletions cmd/bent/scripts/cronjob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ cp ${STAMP} ${tip}-opt.${SFX}

cat ${RUN}.Base.build >> ${BASE}-opt.${SFX}
cat ${RUN}.Tip.build >> ${tip}-opt.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Base.stdout >> ${BASE}-opt.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Tip.stdout >> ${tip}-opt.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Base.stdout >> ${BASE}-opt.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Tip.stdout >> ${tip}-opt.${SFX}
cat ${RUN}.Base.{benchsize,benchdwarf} >> ${BASE}-opt.${SFX}
cat ${RUN}.Tip.{benchsize,benchdwarf} >> ${tip}-opt.${SFX}
benchsave ${BASE}-opt.${SFX} ${tip}-opt.${SFX}
Expand Down Expand Up @@ -167,8 +167,8 @@ cp ${STAMP} ${tip}-Nl.${SFX}

cat ${RUN}.BaseNl.build >> ${BASE}-Nl.${SFX}
cat ${RUN}.TipNl.build >> ${tip}-Nl.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.BaseNl.stdout >> ${BASE}-Nl.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.TipNl.stdout >> ${tip}-Nl.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.BaseNl.stdout >> ${BASE}-Nl.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.TipNl.stdout >> ${tip}-Nl.${SFX}
cat ${RUN}.BaseNl.{benchsize,benchdwarf} >> ${BASE}-Nl.${SFX}
cat ${RUN}.TipNl.{benchsize,benchdwarf} >> ${tip}-Nl.${SFX}
benchsave ${BASE}-Nl.${SFX} ${tip}-Nl.${SFX}
Expand Down Expand Up @@ -204,8 +204,8 @@ cp ${STAMP} ${tip}-l.${SFX}

cat ${RUN}.Basel.build >> ${BASE}-l.${SFX}
cat ${RUN}.Tipl.build >> ${tip}-l.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Basel.stdout >> ${BASE}-l.${SFX}
egrep '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Tipl.stdout >> ${tip}-l.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Basel.stdout >> ${BASE}-l.${SFX}
grep -E '^(Benchmark|[-_a-zA-Z0-9]+:)' ${RUN}.Tipl.stdout >> ${tip}-l.${SFX}
cat ${RUN}.Basel.{benchsize,benchdwarf} >> ${BASE}-l.${SFX}
cat ${RUN}.Tipl.{benchsize,benchdwarf} >> ${tip}-l.${SFX}
benchsave ${BASE}-l.${SFX} ${tip}-l.${SFX}
Expand Down