#!/usr/pkg/bin/bash warn() { echo "$*" >&2 } die() { echo "$*" >&2 exit 1 } if ! [ "$1" ]; then die Usage: $0 INFILE [OUTFILE] fi if echo $2 | grep -iq '\.pdb$'; then outfile=$2 else warn $2 not valid dbname, using $1.pdb instead outfile=$1.pdb fi infile=`basename "$1"` if echo $infile | grep -iq '\.mp3$'; then par c -a "stream" "$outfile" "$infile" strm TNpt "$1" elif echo $infile | grep -iq '\.jpg$'; then par c -a "stream" "$outfile" "$infile" .jpg FLDB "$1" else die I don\'t know how to pilotize $1 fi