I am writing a simple shell script which changes the mac address of the network hardware. One of the line is :
sudo ifconfig eth0 hw ether 00:99:99:00:00:00
echo "password" | sudo -S ifconfig eth0 hw ether 00:99:99:00:00:00