PATCH: bad sed expression

Matthias Andree matthias.andree at gmx.de
Tue Jan 7 03:12:34 CET 2003


David Relson <relson at osagesoftware.com> writes:

> What might work is to use the basename command, as in
>
>          NAME="./`basename $0 | sed s@\./t\.@@`"
>
> It does the right thing on my machine.  Let me know how it works for you.

$0 is evil, particularly if shebang (directly running the test from the
command-line) comes into play. It can be anything, the interpreter, the
shell's name, with or without pass, only it's not telling you the next
day's weather prospects. We haven't yet had reports that $0 was /bin/sh
or something, so it can stay in, but I figured it ultimately took the .*
-- which is on the MIME branch already.

-- 
Matthias Andree




More information about the bogofilter-dev mailing list