From df7eb6361af35e5f9e7310064222344fc514daac Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 2 Dec 2015 13:10:54 -0700 Subject: [PATCH] Improve parsing of readelf output in process_core logic. Sometimes readelf prepends an "fname: " note, to the line with "psargs", and in that case just using awk with $2 does not work. Signed-off-by: Jim Harris Change-Id: I6695352da641111f90be9f3e519accbf05107e91 --- scripts/autotest_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/autotest_common.sh b/scripts/autotest_common.sh index ec9cfe10cf..a2f059595d 100755 --- a/scripts/autotest_common.sh +++ b/scripts/autotest_common.sh @@ -82,7 +82,7 @@ function timing_finish() { function process_core() { ret=0 for core in $(find . -type f -name 'core*'); do - exe=$(eu-readelf -n "$core" | grep psargs | awk '{ print $2 }') + exe=$(eu-readelf -n "$core" | grep psargs | sed "s/.*psargs: \([^ \'\" ]*\).*/\1/") echo "exe for $core is $exe" if [[ ! -z "$exe" ]]; then if hash gdb; then