source: openpam/trunk/clean.sh @ 318

Last change on this file since 318 was 260, checked in by Dag-Erling Smørgrav, 16 years ago

Change '-type f' to '-not -type d' to make sure we also get symlinks
and whatnot.

File size: 362 bytes
Line 
1#!/bin/sh
2#
3# $P4: //depot/projects/openpam/clean.sh#2 $
4
5tmpfile="/tmp/openpam-clean.$$"
6p4 files ... | grep -v 'delete change' |
7    sed 's|^.*/openpam/||; s|#.*$||' > "${tmpfile}"
8find . -not -type d | cut -c 3- | while read file ; do
9    grep "^${file}\$" "${tmpfile}" >/dev/null || rm -v "${file}"
10done
11find . -type d -empty -print -delete
12rm "${tmpfile}"
13
Note: See TracBrowser for help on using the repository browser.