wherechecker.sh #3

  • //
  • guest/
  • michael_shields/
  • scripts/
  • wherechecker.sh
  • View
  • Commits
  • Open Download .zip Download (829 B)
#!/bin/sh

# Print clients in descending order of client map complexity.
#
# Since "p4 where //..." lists the combinations resulting from expanding the
# client map, the number of lines in the "p4 where //..." output can be used
# as a measure of the client's complexity.
#
# Locked clients are problematic; this script ignores locked clients. Clients
# with bad mappings (e.g. mapping to nonexistent depots) are also ignored.

awk=awk
egrep=egrep
p4=p4
printf=printf
sh=sh
sort=sort
wc=wc

# Print the clients.

$p4 -Ztag clients | $egrep '^\.\.\. client |^\.\.\. Host ' | $awk '{ client = $3; getline; printf "'"$printf"' \"%%-64s  \" \"%s\"; '"$p4"' -c \"%s\" -H \"%s\" where //... | '"$wc"' -l\n", client, client, $3 }' | $sh 2>&1 | $egrep -v '  Locked client |^[ ]*0$| - file\(s\) not in client view\.$' | $sort -k 2nr -k 1
# Change User Description Committed
#3 5157 Michael Shields /bin is typically in the path.
#2 5155 Michael Shields Cleaned up comments.
#1 5154 Michael Shields Print clients in descending order of client map complexity.