Hello.
Here is a file contents :
declare -Ax NEW_FORCE_IGNORE_ARRAY=([FORCE_IGNORE15]="§" [FORCE_IGNORE17]="§" [FORCE_IGNORE1]="§" [FORCE_IGNORE16]="§" [FORCE_IGNORE11]="§" .................. [FORCE_IGNORE23]="§"
Here is a pattern
=
I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '='
Is there a better solution than mine :
MY_PATTERN="="
SOME_VAR=$(cat $SOME_FILE | awk -F$MY_PATTERN '{print $1}' | awk '{print $3}' )
echo $SOME_VAR
Any help is welcome