blob: 4d348d9200d10cf46f1bf16d828f07b57154e2d4 (
plain)
1
2
3
4
5
6
7
8
9
10
|
#!/bin/bash
ACCESSLOG="$1"
PATTERN="$2"
OUTPUT="$3"
LINE=`grep "$PATTERN" "$ACCESSLOG" | grep Chrome | tail -n 1`
if [ -n "$LINE" ]
then
COLS=`echo "$LINE" | csvtool -t ' ' width -`
echo "$LINE" | csvtool -t ' ' col $COLS - | sed 's/"//g' > $OUTPUT
fi
|