I'm writing a script which will automatically configure a NIS client with the correct settings. I'm trying to set the /etc/nsswitch.conf file and I'd like to overwrite whatever is already there with my settings. Now my question is, how can I do that? how can i paste about 20 lines of settings into the client's nsswitch.conf file straight from the script? I know i can do something like:
echo "line 1" > /etc/nsswitch.conf
echo "line 2" >> /etc/nsswitch.conf
But that's an ugly way to do it, I hope there is a better way to achieve this goal