LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   rc.inet1.conf not modifyable (http://www.linuxquestions.org/questions/slackware-14/rc-inet1-conf-not-modifyable-4175501681/)

nix84 04-14-2014 11:56 AM

rc.inet1.conf not modifyable
 
I need to modify /etc/rc.d/rc.inet1.conf for wifi purposes.
It has a 600 permission and as root this command:
sed -i 's/IFNAME[4]/IFNAME[7]/' /etc/rc.d/rc.inet1.conf
which only changes the number will not modify the file.
It is an "in place" sed command which allows modification of an input file. Can someone explain why the file will not be modified? I tried modifying other lines and they won't change either.

ponce 04-14-2014 12:00 PM

Quote:

Originally Posted by nix84 (Post 5152387)
sed -i 's/IFNAME[4]/IFNAME[7]/' /etc/rc.d/rc.inet1.conf
which only changes the number will not modify the file.
It is an "in place" sed command which allows modification of an input file. Can someone explain why the file will not be modified?

because you have to escape the '[' and the ']' when matching them: try
Code:

sed -i 's/IFNAME\[4\]/IFNAME[7]/' /etc/rc.d/rc.inet1.conf

nix84 04-14-2014 01:19 PM

Thanx. Been having serious mental schisms over this and have tried innumerable iterations of the command, so much appreciated


All times are GMT -5. The time now is 09:29 PM.