Skip to content

Commit 7d95f53

Browse files
committedMar 31, 2020
Script for printing object creation times and locations based on logs.
1 parent d641a84 commit 7d95f53

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
if [ $# -ne 2 ]
2+
then
3+
echo "Usage:"
4+
echo "./printObjectCreationLocations.sh mapChangeLogFile object_id"
5+
exit
6+
fi
7+
8+
9+
startTime=`echo -n "$1" | sed -e "s/time_mapLog.txt//" | sed "s/.*\///" `
10+
11+
echo "startTime = $startTime"
12+
13+
14+
while read time coord id user
15+
do
16+
timestamp=`echo "$startTime + $time" | bc`
17+
18+
date=`date -d @$timestamp`
19+
20+
echo "$coord || $date || $id "
21+
done < <( cat $1 | sed -e "s/\([0-9.]* \)\([0-9\-]*\) \([0-9\-]*\) /\1(\2,\3) id=/" | grep "id=$2" )

0 commit comments

Comments
 (0)
Please sign in to comment.