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 much does the ticket 22450 (a) cvc (failure to stop at stop sign) cost in california?
Migration from Windows 2000 AD to 2003
How do I add a comma to my string?
on an console app, once i display a question before a console.readline, how to add a default value?
Calculate Running Total in a New Field
Editable Gridview
Web service help
add names to 2nd combo box on form
Need Access VBA help to Use from Access
CSS: Underline in a different color