inspector/grep.search_by_pos

19 lines
448 B
Bash
Executable File

#!/bin/bash
# params: $1,$2,$3: x,y and z coordinate
# 44 amount of results to show
# $5 name of the player who started the search
ROLLBACK_FILE="/usr/local/src/mt/rollback.txt"
TMP_FILE="/tmp/mt.inspector.mode1.$5"
# remove old result files
rm -f $TMP_FILE $TMP_FILE.tmp
echo ' ' > $TMP_FILE.tmp
grep "\" \[set_node ($1,$2,$3) \"" $ROLLBACK_FILE | tail -$4 > $TMP_FILE.tmp
# rename the result file
mv $TMP_FILE.tmp $TMP_FILE