This was only an example - try to understand what it does.
Take a look at the output of ifconfig -a first.
For me it outputs the string "Hardware Adresse"
so for me - this example works:
MYVAR=$(ifconfig -a | awk '/Hardware/{print $1}')
echo $MYVAR
only an example too