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
doc for code review
jQuery Autocomplete with PHP / MySQL [PART 4]
excel 2007 all numbers in spreadsheet converted to date unintentionally
The time on my Cisco Call Manager Express Router is wrong.
What software to apply sysprep'd Win 7 OEM images?
Toggle Buttons changing textbox value in access 2007
How can I stop my laptop crashing when using graphics intensive programs?
Update Query with subquery
Can I revert to a previously published Wordpress page?
where case - parameteres