From 3ed8fc8784496722af85b6ec2ff5120c75db84dc Mon Sep 17 00:00:00 2001 From: roktas Date: Sun, 12 Nov 2006 12:11:25 +0000 Subject: Portability fixes and various cleanups in wrapper scripts: + Fix the tests at the header of wrappers. which(1) doesn't behave as expected on some systems. We should only assume that it's pretty widely available (for example, it's a builtin in csh) and we should only rely on its exit code by ignoring its output. + Replace 'echo -n' with 'printf' as the latter is recommended. + In markdown2pdf script, '--suffix' and '--backup' options of mv(1) appear to be GNU-ism. Apply a workaround. + Wrap some long lines to fit in an 80-column screen. + Remove spaces at the line ends. git-svn-id: https://pandoc.googlecode.com/svn/trunk@92 788f1e2b-df1e-0410-8736-df70ead52e1b --- latex2markdown | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'latex2markdown') diff --git a/latex2markdown b/latex2markdown index eeffb9b1e..e5e276d62 100644 --- a/latex2markdown +++ b/latex2markdown @@ -1,7 +1,11 @@ #!/bin/sh -e # runs pandoc to convert latex to markdown -[ -n "$(which pandoc)" ] || { - echo >&2 "You need 'pandoc' to use this program!" - exit 1 -} + +for p in pandoc; do + which $p >/dev/null 2>&1 || { + echo >&2 "You need '$p' to use this program!" + exit 1 + } +done + iconv -t utf-8 $* | pandoc $PANDOC_OPTS -r latex -w markdown -s | iconv -f utf-8 -- cgit v1.2.3