I am trying to evaluate the following regex in bash,
[[ build: =~ ^([[:space:]]*build) ]]
This line is throwing error as,
malloc: shmatch.c:115: assertion botched
free: start and end chunk sizes differ
Aborting...ABORT instruction (core dumped)
Is there any fix for this?
The entire code snippet is
echo $line : $val;
if [[ "$line" =~ ^([[:space:]]*build) ]]
then
build=$val
fi
this is the code snippet, basically there are 2 variables line and val I wanted to assign value of $val to variable build if the $line starts with "build". e.g. if $line is "build=20" and $val is "35" then I want value of $build equal to 35.
I am using HP-UX 11.31 if this is relevant..