--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- Adressensuche ------------------------- Sam Jul 27 18:32:00 MEST 2002 ------------------------- Adresse Telefonbuch lynx GET-Request ----------------------------------------------------------------------------- Mit lynx können Sie ganz schnell Adressen heraussuchen. ----------------------------------------------------------------------------- Das (einzeilige!) Skript adresse.sh erwartet drei Parameter: Name, Stadt und Postleitzahl. Letztere kann auch gekürtzt sein, zum Beispiel 86 für Augsburg. --------CODE--------: adresse.sh #!/bin/bash # adresse.sh - Searches for names in a online phonebook # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # --------/CODE-------- Natürlich muss es ausführbar gemacht werden: --------CODE--------: chmod iblech@Mars.univer.sum:~ > chmod +x adresse.sh --------/CODE-------- Jetzt kann es sogar in eine Procmail-Recipe eingebaut werden: --------CODE--------: procmailrc :0c * ^Subject: get_adresse * !^X-Loop: ihre@emailadresse * !^Subject: Re: .* * !^FROM_DAEMON | ( cat > /tmp/pmt; \ formail -rA"X-Loop: ihre@emailadresse" < /tmp/pmt; \ formail -I "" < /tmp/pmt | head -n 4 | tail -n 3 | /pfad/zu/adresse.sh `head -n 3`; ) | \ /usr/sbin/sendmail -t -oi -v -r iblech@web.de :0 * ^Subject: get_adresse * !^X-Loop: ihre@emailadresse * !^Subject: Re: .* * !^FROM_DAEMON Posteingang --------/CODE-------- Jede Mail an Sie mit dem Subjekt get_adresse und mit dem Inhalt NameEnterNameEnterStadtEnterPLZ wird nun automatisch beantwortet. Have a lot of fun! ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This document is distributed under the terms of the GNU Free Documentation License.