#!/bin/sh # # opml2mmd --- MultiMarkdown convenience script # # Copyright (c) 2010-2011 Fletcher T. Penney # # Convert "MMD" styled OPML file to MultiMarkdown text # # Be sure to include multimarkdown in our PATH export PATH="/usr/local/bin:$PATH" # Locate XSLT directory xslt_path=`dirname "$0"` if [ $# = 0 ] then # No arguments, so use stdin/stdout # XSLT to convert OPML to MMD xsltproc -nonet -novalid "$xslt_path/../XSLT/opml2mmd.xslt" - shift else until [ "$*" = "" ] do # process each argument separately file_name=`echo "$1"| sed 's/\.[^.]*$//'` # XSLT to convert OPML to MMD xsltproc -nonet -novalid "$xslt_path/../XSLT/opml2mmd.xslt" "$1" > "$file_name.txt" shift done fi