#!/bin/bash
#This script splits 'p4 configure show' output and adds
#'p4 configure set' in front of the key-value pairs.
#The output can then be run against a server to replicate
#the customers config.
echo "Please enter the name of the source file containing the p4 configure show output"
read sourcefile
echo "The file containing config data is $sourcefile"
#Split out the key-value pairs:
while read line
do
echo "p4 configure set $line"
done < <(cat $sourcefile | cut -d':' -f2) >> output.txt