Microsoft
Software
Hardware
Network
Question : Sed help
Hello,
I have got a file pattern like below:
#cat test
PermitRootLogin yes
#PermitRootLogin yes
PermitRootLogin no # some text
PermitRootLogin some text
##PermitRootLogin yes
I need a Sed command that will replace all the lines "PermitRootLogin" entries into following format:
PermitRootLogin no
PermitRootLogin no
PermitRootLogin no
PermitRootLogin no
PermitRootLogin no
I tried with the following but it not working fully,
sed 's/PermitRootLogin.*$/Perm
itRootLogi
n no/' test
Please let me know. Thanks !
Answer : Sed help
sed -e 's/^.*PermitRootLogin.*$/P
ermitRootL
ogin\ no/g' file > file.new
Random Solutions
aspnet, gridview.. Trimming the data in the bound controls
Homemade plastics
Tools/automated testing tools for testing ASP.NET web applications
How to Specify What Websites can run ActiveX?
Adding additional storage to an ESXi server
SQL Temporary Tables MS SQL 2005
Windows 7 Enterprise MAK activation erros
Useless Windows 7 Services?
Deploying Windows 7 via K2000
Event ID 59 and 32 sidebyside