mkgroup.sh #1

  • //
  • guest/
  • lester_cheung/
  • scripts/
  • mkgroup.sh
  • View
  • Commits
  • Open Download .zip Download (553 B)
#!/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
# Change User Description Committed
#1 8149 Lester Cheung Random script to recreate groups from output of "p4 groups -v".