Benutzer:Heernis/Nützliche Skripte: Unterschied zwischen den Versionen

Aus EnzyklopAtys

Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „ <syntaxhighlight lang="bash"> #!/bin/bash # watch the log | filter only channel ryzomforge | delete first letters | remove every @{AFBF} | remove all line wi…“)
 
Zeile 22: Zeile 22:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
<syntaxhighlight lang="bash">
 +
#!/bin/bash
 +
# cut out a part of the log based on time
 +
CHAR="heernis"
 +
 +
YEAR1="2018"
 +
MONTH1="06"
 +
DAY1="12"
 +
HOUR1="18"
 +
MIN1="39"
 +
 +
YEAR2="2018"
 +
MONTH2="06"
 +
DAY2="12"
 +
HOUR2="18"
 +
MIN2="40"
 +
 +
sed -n "/"$YEAR1"\/"$MONTH1"\/ "$HOUR1":"$MIN1"/,/"$YEAR2"\/"$MONTH2"\/"$DAY2" "$HOUR2":"$MIN2"/p" log_heernis.txt > log_heernis_cutout.txt
 +
 +
</syntaxhighlight>
  
  
  
 
<!--<syntaxhighlight lang="bash"></syntaxhighlight>-->
 
<!--<syntaxhighlight lang="bash"></syntaxhighlight>-->

Version vom 13. Juni 2019, 20:20 Uhr

#!/bin/bash

# watch the log | filter only channel ryzomforge | delete first letters | remove every @{AFBF} | remove all line with <INFO> | write it into  ryomforge_live.txt

tail -f ~/.local/share/Ryzom/0/save/log_heernis.txt | grep --line-buffered "(DYN3)" | sed -u -e 's/\(.\{40\}\)//' | sed -u -e 's/@{AFBF}//g' | sed -u -e "s/^<INFO>.*$//g"  >> ryomforge_live.txt
#!/bin/bash
# read the log | filter only channel ryzomforge | delete first letters | remove every @{AFBF} | remove all line with <INFO> | write it into  ryomforge_archive.txt

cat ~/.local/share/Ryzom/0/save/log_heernis.txt | grep "(DYN3)" | sed -e 's/\(.\{51\}\)//' | sed -e 's/@{AFBF}//g' | sed -e "s/^<INFO>.*$//g"  >> ryomforge_archive.txt
#!/bin/bash
#watch the log | filter only channel SAY/EMT | exchange charname with <Spieler> |exchange Aeps Zessen with <Ziel> | write it into  emotes.txt
tail -f /home/$USER/.local/share/Ryzom/0/save/log_heernis.txt | grep --line-buffered '(SAY/EMT)' | sed -u -e 's/\(.\{32\}\)//' | sed -u -e 's/\Heernis\b/<Spieler>/g' | sed -u -e 's/\Aeps Zessen\b/<Ziel>/g' >> emotes.txt
#!/bin/bash
# cut out a part of the log based on time
CHAR="heernis"

YEAR1="2018"
MONTH1="06"
DAY1="12"
HOUR1="18"
MIN1="39"

YEAR2="2018"
MONTH2="06"
DAY2="12"
HOUR2="18"
MIN2="40"

sed -n "/"$YEAR1"\/"$MONTH1"\/ "$HOUR1":"$MIN1"/,/"$YEAR2"\/"$MONTH2"\/"$DAY2" "$HOUR2":"$MIN2"/p" log_heernis.txt > log_heernis_cutout.txt