#!/bin/bash ## by Eugene Reimer 1998; ## BEWARE of using this script in /usr or anywhere you have files named tmp* or *.tmp you want to keep!! if [ $# -ge 1 ]; then cd "$1"; fi GLOBIGNORE="." ##2008-10-30: so star works in glob-patterns (eg: to match .htaccess~) rm -fv {,*/,*/*/}{tmp*,*~,*.bak,*.tmp,core} | tr '\n' ' ' |sed 's|removed ||g; s|^...*|clean-quickly: &\n|' ##simplify msgs; nl->space; add "clean-quickly" + ending-nl ONLY if nonempty exit ============ CLEAN RULES: ============ rm -R .xvpics --pollution by GIMP, is a directory (obsolete) rm *~ --tilde-backup rm *.bak; --pollution by aspell rm *.tmp; --pollution by ghostview ==BEWARE== rm tmp* --scalepix etc ==BEWARE== rm core --core-dump rm soffice.lck --pollution by StarOffice (obsolete) ==FIXME: use -fR (at least on tmp*) in order to remove tmpDIR--??-- CONSIDER also removing files /tmp/bk-chg-[DIR* as made by chg --tmpbackup; so as to make be the way to "begin a series of revisions that may need undoing", even for revisions done with which makes such /tmp backup-copies (ordinarily makes tilde-backup in current directory); decided i can live with semi-manual undoing of an erroneous chg --tmpbackup; expect to use the --tmpbackup option mainly from /er/webput script for the ALT/TITLE revisions. 2006-10: added *.bak (aspell) - was in /er/webput; 2006-10: split this from ; the slow recursive version is ; this faster variant ; ==2010-10-20: swap -->clean-thoroughly -->clean; NOTE: WEBPUT-LL is where I most wanted a faster clean, so am using clean-quickly there; support DIR-parameter, as needed from bk script; NEEDED: implement other rules from and make recursive -- so can replace ALL uses of ; 2008-09-20: used under /home/ereimer, and saw the following being removed (SPURIOUSLY due to my ghostview-rule for *.tmp): .googleearth/myplaces.kml.tmp .ies4linux/ie6/drive_c/windows/temp/www239c.tmp (ie6 seems ok without that file) 2008-10-19: improved output msgs; now clean under subdirs also (not recursive, but adequate for the depth of my file-tree); 2010-10-20: added *.tmp core -- the only non-obsolete rules from that were missing here; ie: this script can now replace all uses of ; name-swapping: the slow recursive variant clean-->clean-thoroughly; faster variant clean-quickly-->clean; revised uses of clean-quickly-->clean within: WEBPUT-LL mk-operashow sitemap-gen webclean webput;