| #!/bin/bash | |
| # | |
| # Sample bash script as external command invoked by parse-ext plugin | |
| # | |
| # 20040701, John Xing | |
| set -e | |
| if [ $# -ne 1 ]; then | |
| echo Usage:$0 mimeType >&2 | |
| exit 1 | |
| fi | |
| case $1 in | |
| "application/vnd.nutch.example.cat") | |
| cat | |
| ;; | |
| "application/vnd.nutch.example.md5sum") | |
| md5sum | |
| ;; | |
| *) | |
| echo "Can't parse mimeType $1" >&2 | |
| exit 1 | |
| esac |