Skip to content

Instantly share code, notes, and snippets.

@zenloner
Created January 25, 2013 03:35
Show Gist options
  • Save zenloner/4631541 to your computer and use it in GitHub Desktop.
Save zenloner/4631541 to your computer and use it in GitHub Desktop.
#! /bin/bash
while getopts "i:o:" opt; do
case $opt in
i ) input="$OPTARG" ;;
o ) output="$OPTARG" ;;
esac
done
#字符串替换使用这样方式,可以方便的替换,也可以使用自带的${string/sub/replace}
#input=`echo "$input" | sed 's/\ /\\\ /g'`
#echo $input
#output=`echo "$output" | sed 's/\ /\\\ /g'`
#echo $output
#变量最好都使用双引号
pandoc "$input" | tidy -q -i -utf8 --doctype omit --tidy-mark 0 --show-errors 0 -o "$output"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment