I would like to change the line "disable = yes" to "disable = no" into the following file :
[root@centos2 ~]# cat /etc/xinetd.d/tftp
service tftp
{
...
server_args = -s /var/lib/tftpboot
disable = yes
per_source = 11
...
}
I tried this :
[root@centos2 ~]# grep 'disable = yes' /etc/xinetd.d/tftp
[root@centos2 ~]#
by just copying the space with my mouse but it doesn't grep anything...
Why and how can I know what are the elements between "disable" and "=" ? Is it several spaces? tabulations?
I know I can grep using the following regex :
[root@centos2 xinetd.d]# grep -E 'disable.+= yes' /etc/xinetd.d/tftp
disable = yes
[root@centos2 xinetd.d]#
And finaly, is there a better way of replacing "yes" by "no" using sed than the following :
[root@centos2 xinetd.d]# sed -r 's/disable.+= yes/disable =
no/g' /etc/xinetd.d/tftp
service tftp
{
...
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
...
}
EDIT :
Result of the od command thanks @ilkkachu
[root@centos2 xinetd.d]# < /etc/xinetd.d/tftp grep disable | od -c
0000000 \t d i s a b l e
0000020 = y e s \n
0000037