#!/bin/sh
if [ $# -ne 1 ]; then
echo "usage: $0 <'p4 groups -v' output from a difference server>"
echo "Script to create groups from 'p4 groups -v' output."
fi
mkgroup()
{
gname=$1
maxresults=$2
maxscanrows=$3
maxlocktime=$4
timeout=$5
p4 group -o $gname|grep -v '^#'| \
sed "s|^MaxResults:.*|MaxResults: $maxresults|"| \
sed "s|^MaxScanRows:.*|MaxScanRows: $maxscanrows|"| \
sed "s|^MaxLockTime:.*|MaxLockTime: $maxlocktime|"| \
sed "s|^Timeout:.*|Timeout: $timeout|"| \
p4 group -i
}
while read line; do
mkgroup $line
done