p4 client
can use standard input and output.
export P4CLIENT=myworkspace
p4 client -o > /tmp/myclient.$$ # Write client to a temp file
# Commands to update /tmp/myclient with the changes you need
p4 client -i < /tmp/myclient.$$
p4 sync
rm /tmp/myclient.$$