Shell cat END
Published: Tuesday, Nov 11, 2008 Last modified: Monday, Dec 9, 2024
How not to do it:
essid="test"
key="blah"
cat << END
network={
ssid="$essid"
key_mgmt=WPA-PSK
psk="$key"
}
END > /tmp/bar.txt
How to do it as sudo:
sudo sh -c "cat<> /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="$essid"
key_mgmt=WPA-PSK
psk="$key"
}
END"
Thanks #bash on Freenode :)