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
Using Key Management Services for WS 2008 in an SBS 2003 environment.
tighten up table II
convert.decimal problem
What clients besides Outlook support RPC over HTTP?
Possible Hardware Fault HP Smart Array Embedded Controller 5i
Unable to open a folder placed on desktop - restriction issues
Windows updates issue
How to generate HTML String?
ASA - Startup and Running Config discrepency
Migrating from XP professional to Windows 7 Home