Hallo Thilo, Thilo A. Coblenzer schrieb:
Euch Zwei vielen Dank für die Hilfe! Mit shell patterns kenne ich mich gar nicht aus. Daher muß ich sagen, daß mir der Ausdruck ein Buch mit sieben Siegeln ist.
Suche in "man bash" nach "Pattern Matching", den Suchbegriff kannst du nach drücken von / eingeben.
OK, ich sehe ein das "-a" ein logisches "und" ist und "!" die Negierung.
Richtig.
Das "Spam*" verstehe ich auch noch. Aber was das "?*" mit den Punkt-Files zu tun hat, finde ich nicht so intuitiv.
Aus "man find": [...] -name pattern Base of file name (the path with the leading directories removed) matches shell pat- tern pattern. The metacharacters (`*', `?', and `[]') do not match a `.' at the start of the base name. To ignore a directory and the files under it, use -prune; [...]
Aber na ja - auf jeden Fall zeigt mir find nun die gewünschten Dateien an. Leider bin ich immernoch nicht so ganz am Ziel. Das Problem ist wohl, daß ich jetzt eine ganz Liste von Dateien habe. Ich muß es irgendwie schaffen, Bogofilter nach und nach mit den Dateien zu füttern. Im Moment sieht es so aus: thilo@vlinux:~$ bogofilter -n -v < `find ~/Mail/ -name Non*` # 8671 words, 31 messages Funktioniert also. Das find liefert allerdings auch nur eine Datei: thilo@vlinux:~$ find ~/Mail/ -name Non* /home/thilo/Mail/Non-Spam Wenn ich jetzt allerdings mehrere Dateien habe, funktioniert es nicht mehr: thilo@vlinux:~$ bogofilter -n -v < `find ~/Mail/ -name SuSE*` -bash: `find ~/Mail/ -name SuSE*`: ambiguous redirect thilo@vlinux:~$ find ~/Mail/ -name SuSE* /home/thilo/Mail/.Linux.directory/SuSE-Laptop /home/thilo/Mail/.Linux.directory/SuSE-Linux /home/thilo/Mail/.Linux.directory/SuSE-Multimedia /home/thilo/Mail/.Linux.directory/SuSE-Programming /home/thilo/Mail/.Linux.directory/SuSE-Talk
Oder natrülich auch: thilo@vlinux:~$ bogofilter -n -v < `find ~/Mail -type f -name \?\* -a ! -name Spam\* -print` -bash: `find ~/Mail -type f -name \?\* -a ! -name Spam\* -print`: ambiguous redirect Wie kann ich dem denn jetzt noch begegnen?
Indem du bogofilter in einer Schleife mit einer Datei nach der anderen Aufrufst. Das geht sehr schön in der Shell: for element in `find ...`; do bogofilter -n -v < $element; done In die backticks musst du natürlich den kompletten find-Aufruf setzen. Gruß christian