tm 7.32.
[elisp/tm.git] / methods / tm-plain
1 #!/bin/sh
2 if [ "$TM_TMP_DIR" = "" ]; then
3         TM_TMP_DIR=/tmp
4         export TM_TMP_DIR
5 fi
6 if [ "$5" = "" ]; then
7         filename="$TM_TMP_DIR/mime$$.pln"
8 else
9         filename="$TM_TMP_DIR/$5"
10 fi
11
12 echo "$2; $3 -> $filename"
13
14 tmdecode $3 $1 $filename
15
16 case "$4" in
17 "play")
18         cat $filename
19         /bin/rm $filename
20         ;;
21 "extract")
22         echo "extract to $filename"
23         ;;
24 "print")
25         txt2ps -n $filename | lpr
26         /bin/rm $filename
27         ;;
28 esac