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
Help with Microsoft Excel Formula
Atheros AR8152 PCI-E Fast EThernet Cont
SQL - Combining multiple fields into one
How to display just a folder name, NOT the full folder path for open folders in the taskbar, XP Pro
Lables printing problem using MS Word
Kerio MailServer not geting all mails from outside
outlook 2007 keeps faulting in module msoert2.dll
Java Calculator Problem
XPath newbie
Does anyone no a really good freeware Password Manager?