Example Swish-e Filter Modules

Filter for document:     Sample
swish-e option:
FileFilter  .???   sample.sh
Software needed:
Script filename: sample.sh
Script sample:
#!/bin/sh
echo "File to convert: $1"
echo "URL or Filename: $2"
echo "If arg 2 is not empty this"
echo " this is the  filename or url"
echo " (means: $1 = temp. file)"

Filter for document:     Acrobat PDF - Files
Adobe Portable Document Format
swish-e option:
FileFilter  .pdf   pdf-filter.sh
Software needed: XPDF: http://www.foolabs.com/xpdf/
Script filename: pdf-filter.sh
Script sample:
#!/bin/sh
/usr/local/bin/pdftotext "$1" - 2>/dev/null 

Filter for document:     Any files with text strings embedded
swish-e option:
FileFilter  .bin   extract.sh
Software needed: Unix "strings"-command
Script filename: extract.sh
Script sample:
#!/bin/sh
strings <"$1" 2>/dev/null 

Filter for document:     Compressed Files
The Script has to evaluate the document type to do additional converting if neccessary.
swish-e option:
FileFilter  .gz   gzip-filter.sh
Software needed: GNU gzip
Script filename: gzip-filter.sh
Script sample:
#!/usr/local/bin/perl
$GZIP="/usr/local/bin/gzip";

$src_name=@ARGV[1];
if ($src_name eq "") {
   $src_name = @ARGV[0];
}

system ("cat \"@ARGV[0]\" | gzip -d");



Rainer.Scherg@t-online.de