"Fossies" - the Fresh Open Source Software Archive

Member "usr/share/Ted/examples/rtf2txt.sh" (1 Feb 2013, 541 Bytes) of package /linux/misc/old/ted-2.23-linux-amd64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 ########################################################################
    4 #
    5 #  Convert an rtf document to plain text format using 'Ted'.
    6 #
    7 #  Usage    rtf2txt.sh something.rtf something.txt
    8 #
    9 #  This is an example. Refer to http://www.nllgg.nl/Ted/index.html for the
   10 #  'Ted' documentation.
   11 #
   12 ########################################################################
   13 
   14 case $# in
   15     1)
   16     rtf="$1";
   17     txt=`basename "$1" .rtf`.txt
   18     ;;
   19     2)
   20     rtf="$1";
   21     txt="$2";
   22     ;;
   23     *)
   24     echo $0: '$#='$#
   25     exit 1
   26     ;;
   27 esac
   28 
   29 Ted --saveTo "$rtf" "$txt"
   30