diff mbox series

tests/toolbox.inc.sh: update regex for getting endian

Message ID 20221202073412.90239-1-changqing.li@windriver.com (mailing list archive)
State New
Headers show
Series tests/toolbox.inc.sh: update regex for getting endian | expand

Commit Message

Changqing Li Dec. 2, 2022, 7:34 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

Update regex for get endian to following condition:
/proc/777/exe: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 tests/toolbox.inc.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/toolbox.inc.sh b/tests/toolbox.inc.sh
index 609a6c7..b1943a1 100644
--- a/tests/toolbox.inc.sh
+++ b/tests/toolbox.inc.sh
@@ -13,10 +13,10 @@ 
 echo === $OUTPUTFILE ===
 
 endian=`file -L /proc/$$/exe`
-if expr "$endian" : '.* MSB \+\(pie executable\|executable\|shared object\).*' >&/dev/null
+if expr "$endian" : '.* MSB .*\(pie executable\|executable\|shared object\).*' >&/dev/null
 then
     endian=BE
-elif expr "$endian" : '.* LSB \+\(pie executable\|executable\|shared object\).*' >&/dev/null
+elif expr "$endian" : '.* LSB .*\(pie executable\|executable\|shared object\).*' >&/dev/null
 then
     endian=LE
 else