in-place edit
-i means instead of taking streams/files as input and output, only one file is read and changed
s/y/x/g is a replace function, which is used to replace all occurences of y with x
it supports regular expressions
what the script does is replace delimiter chars like " ", "=", ":" with "," and then delete all multiple occurences
when that is done you can use simple line.split(",") with any program and select the array index you want without any further processing to display the data fields in a page or program
In short sed is a
stream
editor which means it ignore line breaks...
when you want to do per-line-manipulation you can use line based editors like awk scripts, which are also very powerful, but limited to whole lines..
when viewing logs for exploit/cheat discovery or something that you server rules don't want to happen, its easier to just grep a bit of info directly to a file and look into it, like:
Code:
grep "2011-10-23 16:1" > x.txt
to get everything that has happened within 10 minutes, or use
Code:
grep -e "2011-10-23.*task:roleid=1024" world2.log
to get all quest stuff a certain character has done in one day... feel free to use
Code:
grep -e "2011-10-23.*task:roleid=1024" world2.log|last -n x> test.txt
to only get the last x actions/lines
the possibilities are countless as most unix tools support regular expressions in some way
Edit: read pages like this when you want to do something special and after that you should know what stuff to google to get all information you need....
Just keep in mind the internet-knowledge-gather-rule: search engines are you friend, use them whenever possible before asking anything anywhere