forked from perforce/p4transfer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummarise_log.sh
More file actions
21 lines (17 loc) · 734 Bytes
/
summarise_log.sh
File metadata and controls
21 lines (17 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Produce a summary log file for reporting problems with P4Transfer.
# Please run this script on your log file and send the results to consulting@perforce.com or your
# direct Perforce contact.
#
# It extracts the header information and the details of the failing changelist at the end of the log
# file.
#
# Usage:
# sum_log.sh log-P4Transfer-20141208094716.log > sum.log
log_file=$1
head_count=`head -200 $log_file | grep -n "src('changes'" | head -1 | cut -d: -f1`
last_change_line_no=`grep -n "Processing change:" $log_file | tail -1 | cut -d: -f1`
lines=`wc -l $log_file | sed -E 's/^ *//' | cut -d" " -f1`
tail_count=$(( $lines - $last_change_line_no ))
head -$head_count $log_file
tail -$tail_count $log_file