[Nottingham] saved by the shell ?
Andrew Etches
seadog at mehmoo.com
Tue May 20 18:37:04 BST 2008
> i have shell access to the server so was hoping i could use some command-line
> trickery to remove all messages with a given subject line.
>
> after a bit of googling i figure i need something along the lines of :-
> grep "My Subject Line" ./* | xargs rm
> but i'm getting an error "bin/grep: Argument list too long"
Perhaps something really ugly like:
for a in *; do echo $a | perl -e '$b = <stdin>; if($b =~ /your regex/){ unlink $b; }'; done;
(told you it was ugly...)
--
Man will never be free until the last king is strangled with the
entrails of the last priest.
-Denis Diderot
More information about the Nottingham
mailing list