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
How do I get a whole row formatted a certain color using conditional formatting
How do I retrive data from a mirrored disk in windows xp
Legacy Exchange 2000 Server - How To Remove
Upgrading Forest to 2008 R2 and Exchange 2010
Stored Procedure is trimming off the decimals...
method for finding similar websites
Static NAT On Interface with Range - Cisco ASA
Visual Basic - populating a varying text box from another form
database for countries, states, cities and if the city is from usa then zip code
Exchange - send as secondary SMTP address