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
SQL Select query
A perl problem -- use of global variables.
hasError property of a form
Store result of web browser in file
problem connecting to backend database
Gericom Notebook charger enters in short protection how to fix it?
favicon not showing up in IE8
Can't use WebEx, get "setting up event center" message
Connecting two LANS in different locations
Closing Quickbooks 2007 results in a .NET Broadbast Event Window Error