#! /bin/sh # wwwoffle-cache-regexp-rm -- remove URLs via regular expressions # from the WWWOFFLE cache # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/comp/wwwoffle/ # Created On : July 2001 # Last Modified On: Sat Feb 6 02:46:18 2010 # Update Count : 29 test $# -ne 2 && { 1>&2 cat < /dev/null && { 1>&2 echo $0: can\'t use on e.g. monitor, lasttime, etc. directories. exit 55;} set -e filelist=`wwwoffle-ls "$1"|awk ' {a=$6; sub("'$1'","",a); if (a ~ "'$2'") {print $6 | "sort";flag=1}} END{if (!flag){print "'$0': no matches" > "/dev/stderr" ;exit 1}}'` echo "$filelist"|${PAGER-cat} #should put in awk so can check $?... echo -n 'Delete these? [N]|y ' read answer test "x$answer" = xy && echo $filelist|xargs -n 1 wwwoffle-rm #could also: && if that directory is empty, ask about removing it too...