env variable mac address script problems
I have been trying for days to try and get the following script to load the mac variable upon boot in the rc.local file and just can't seem to get it to work. It does work when I manually run the line but when I run it as a normal sh script, it doesn't work.
mac=`ifconfig -a eth0 | grep "HWaddr" | cut -d " " -f 11` | tr -s : .
Maybe there is a different way of accomplishing this, all I want is a variable with my eth0 mac address with . instead of : seperating them. Any help would be greatly appreciated.
Thanks so much!!