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
outlook 2007 keeps faulting in module msoert2.dll
what does a sys admin do?
Lables printing problem using MS Word
IIF Statement
trouble moving a session variable into javascript
Atheros AR8152 PCI-E Fast EThernet Cont
TS profiles v2 for Windows Server 2008 are empty
ASP.NET - why would I get this error on my host when I do not get it on my localhost
Excel 2010 Check Compatibilty / Workbook_BeforeClose - VBA
Networking problems windows 7, typing on computer B appears on computer A